本文共 795 字,大约阅读时间需要 2 分钟。
网站主页的配置:
#我的主页 server { listen 80; charset utf-8; server_name www.zksky.top; root /var/www/html; index index.html index.htm; location / { try_files $uri $uri/ =404; } }
博客网站配置
#我的博客网站,nginx反向代理 server { listen 80; charset utf-8; server_name blog.zksky.top; location / { proxy_pass http://www.zksky.top:8081/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #nginx跟后端服务器连接超时时间(代理连接超时) proxy_connect_timeout 300; #后端服务器数据回传时间(代理发送超时) proxy_send_timeout 300; #连接成功后,后端服务器响应时间(代理接收超时) proxy_read_timeout 300; } }
转载地址:http://gwyws.baihongyu.com/