You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置Apache Httpd处理Safari推送通知的Agent请求

Mapping Safari Push Notification Nginx Config to Apache Httpd

Hey there! I’ve tackled this exact migration before when switching from Nginx to Apache for Safari push notifications, so let me break down how to translate that Nginx config into Apache-friendly syntax.

First, make sure you have these Apache modules enabled—they’re required for handling CORS headers and forwarding requests to your PHP-FPM backend:

  • mod_proxy
  • mod_proxy_fcgi
  • mod_headers

On most Debian/Ubuntu systems, you can enable them with these commands:

a2enmod proxy proxy_fcgi headers
systemctl restart apache2

1. Safari Push Package Request Configuration

This maps directly to your Nginx /push/v2/pushPackages/web.com.domain.appname location block. Add this to your Apache virtual host config:

<Location "/push/v2/pushPackages/web.com.domain.appname">
    # Allow cross-origin requests (matches Nginx's add_header)
    Header set Access-Control-Allow-Origin "*"
    # Allow all clients to access this endpoint (matches Nginx's allow all)
    Require all granted
    # Forward request to PHP-FPM backend, specifying the script file (combines fastcgi_pass and SCRIPT_FILENAME)
    ProxyPass "fcgi://127.0.0.1:9000/var/www/safari.push/index.php"
    ProxyPassReverse "fcgi://127.0.0.1:9000/var/www/safari.push/index.php"
</Location>

2. Safari Push Log Configuration

Similarly, here’s the Apache equivalent for the Nginx /push/v2/log block:

<Location "/push/v2/log">
    Header set Access-Control-Allow-Origin "*"
    Require all granted
    ProxyPass "fcgi://127.0.0.1:9000/var/www/safari.push/log.php"
    ProxyPassReverse "fcgi://127.0.0.1:9000/var/www/safari.push/log.php"
</Location>

Quick Notes

  • If you’re using an older Apache setup with mod_fastcgi instead of mod_proxy_fcgi, the syntax will differ slightly—let me know if you need that version.
  • Double-check the path to your PHP files (/var/www/safari.push/...) matches your actual server setup.
  • After updating the config, restart Apache to apply changes.

If you hit any snags with module loading, permission issues, or path mismatches, feel free to share more details—I’m happy to help troubleshoot further!

内容的提问来源于stack exchange,提问作者Kirill Barsukov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 11:22:27