发布时间:2018-09-29 17:39:01 作者:佚名 阅读:(179)
server { listen 83;//端口号就是刚才在防火墙添加的端口号 server_name www.itbiancheng.com itbiancheng.com ; root /home/wwwroot/www.itbiancheng.com; index index.php index.html; fastcgi_intercept_errors on; error_page 500 502 503 504 /50x.html; error_page 404 /404.html; location = /50x.html { root /var/www/nginx-default; } include enable-php.conf; if ($host = 'itbiancheng.com') { rewrite ^/(.*)$ https://www.itbiancheng.com/$1 permanent; } location ~* ^/(uploadimg|uploads)/.*.(php|php5)$ { deny all; } if (!-e $request_filename) { rewrite ^/([a-zA-Z]+)$ /$1/ permanent; #换栏目重定向 rewrite ^/news/60925.html /langrensha/60925.html permanent; rewrite ^/news/66860.html /langrensha/66860.html permanent; rewrite ^/news/63276.html /yulu/zaoanxinyu/63276.html permanent; } access_log off; }代理机nginx设置:
server { listen 80; server_name www.itbiancheng.com itbiancheng.com; location / { access_log off; proxy_pass http://192.168.1.204:83;//192.168.1.204 根据实际情况更改成自己的IP,端口号是上面设置的 proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
欢迎分享转载→ nginx反向代理配置
permission denied什么意思
(113298)人喜欢 2022-11-30Nginx禁止指定UA访问的方法_nginx屏蔽指定的user_agent
(843)人喜欢 2022-10-25Apache Struts2远程代码执行漏洞(CVE-2020-17530)
(822)人喜欢 2022-10-14Linux下使用ipset封大量IP及ipset参数说明
(962)人喜欢 2022-10-14iptables ipset重启失效_ipset重启生效的方法
(1969)人喜欢 2022-09-27在Windows中配置Rsync同步_windows使用rsync同步文件
(437)人喜欢 2019-12-26© 2015-2021 - 吾爱编程网 版权所有 苏ICP备18033726号-1关于我们 - 网站声明 - 联系我们