站点配置文件(修改成自己的IP)

/www/server/panel/vhost/nginx目录下

t1t.pusdn.com.conf

  1. server
  2. {
  3. listen 80;
  4. server_name t1t.pusdn.com;
  5. index index.php index.html index.htm default.php default.htm default.html;
  6. root /www/wwwroot/t1t.pusdn.com;
  7. #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  8. #error_page 404/404.html;
  9. #SSL-END
  10. #ERROR-PAGE-START 错误页配置,可以注释、删除或修改
  11. #error_page 404 /404.html;
  12. #error_page 502 /502.html;
  13. #ERROR-PAGE-END
  14. #PHP-INFO-START PHP引用配置,可以注释或修改
  15. #引用反向代理规则,注释后配置的反向代理将无效
  16. include /www/server/panel/vhost/nginx/proxy/t1t.pusdn.com/*.conf;
  17. include enable-php-00.conf;
  18. #PHP-INFO-END
  19. #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  20. include /www/server/panel/vhost/rewrite/t1t.pusdn.com.conf;
  21. #REWRITE-END
  22. #禁止访问的文件或目录
  23. location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
  24. {
  25. return 404;
  26. }
  27. #一键申请SSL证书验证目录相关设置
  28. location ~ \.well-known{
  29. allow all;
  30. }
  31. access_log /www/wwwlogs/t1t.pusdn.com.log;
  32. error_log /www/wwwlogs/t1t.pusdn.com.error.log;
  33. }

upstream节点配置文件(修改成自己的IP)

/www/server/panel/vhost/nginx目录下
upstream_t1t.conf

  1. upstream t1t {
  2. #ip_hash;
  3. server 172.18.235.53:8080 max_fails=2 fail_timeout=180s weight=1;
  4. server 172.18.235.52:8080 max_fails=2 fail_timeout=180s weight=1;
  5. sticky name=bt_route expires=12h httponly;
  6. }

负载配置文件(修改成上方upstream名称)

/www/server/panel/vhost/nginx/proxy/t1t.pusdn.com目录下
load_balance.conf

  1. #PROXY-START
  2. location / {
  3. proxy_pass http://t1t;
  4. proxy_set_header Host $host;
  5. proxy_set_header X-Real-IP $remote_addr;
  6. proxy_set_header REMOTE-HOST $remote_addr;
  7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
  9. }
  10. #PROXY-END