# Apache 2.4.26+ 的独立 HTTPS vhost 候选模板;尚未部署验收,不与 Nginx 同时监听同一端口。 # 需要 ssl/rewrite/proxy/proxy_fcgi/headers;只修改本站,不能启用任意路径 PHP 代理。 ServerName pay.example.com ServerAlias pay-alt.example.com DocumentRoot /srv/mpay-v1/app/public SSLEngine on SSLCertificateFile /srv/mpay-v1/tls/fullchain.pem SSLCertificateKeyFile /srv/mpay-v1/tls/privkey.pem SSLProtocol -all +TLSv1.2 +TLSv1.3 ProxyRequests Off ErrorLog /srv/mpay-v1/logs/apache-error.log LogLevel warn # 不使用含完整请求行的默认 combined 格式;这里只记录方法、状态与字节数。 CustomLog /srv/mpay-v1/logs/apache-access.log "%t %m %>s %B" LimitRequestBody 3145728 RewriteEngine On RewriteCond /srv/mpay-v1/run/maintenance.flag -f RewriteRule ^ - [R=503,L] AllowOverride None Options -Indexes -MultiViews +FollowSymLinks Require all granted DirectoryIndex index.php RewriteEngine On RewriteRule (^|/)\. - [F,END] RewriteRule ^index\.php$ - [END] RewriteRule ^(?:submit|mapi|api)\.php$ index.php [END] RewriteRule \.php(?:/|$) - [R=404,END,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [END] Require all denied # Location 匹配固定入口,不能把 storage/index.php 等同名文件交给 FPM。 Require all granted SetHandler "proxy:unix:/srv/mpay-v1/run/fpm.sock|fcgi://localhost/" ProxyFCGISetEnvIf "reqenv('REQUEST_URI') =~ m|^([^?]*)|" PATH_INFO "$1" ProxyFCGISetEnvIf "true" HTTPS "on" AllowOverride None RewriteEngine Off Options -Indexes -ExecCGI -FollowSymLinks Require all denied Require all granted SetHandler default-handler Header always set X-Content-Type-Options nosniff