上一篇文章的配置可以用来通用地部署php测试站点,但是有的时候部分应用程序只是暴露在本地端口,以下贴出反代版配置。
server
{
listen 80;
listen 443 ssl http2;
server_name ~(.+)\.port\.example\.com$;
index index.php index.html index.htm;
set $port $1;
ssl on;
ssl_certificate /path/to/your.cer;
ssl_certificate_key /path/to/your.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
location /
{
proxy_pass http://127.0.0.1:$port;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
}
access_log off;
}
本文由 hunsh 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Aug 26, 2019 at 09:46 pm