登录  /  注册
博主信息
博文 51
粉丝 0
评论 1
访问量 81284
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
Nginx域名80端口转发到其他内网服务器
鱼的熊掌
原创
1763人浏览过

server
{
listen 80;
server_name cc.test.com 10.155.75.71;
index index.php index.html index.htm default.php default.htm default.html;
root D:/BtSoft/stop;

  1. #server_name $host; 转发到内网71服务器
  2. location / {
  3. proxy_pass http://10.155.75.71:80/;
  4. proxy_set_header Host cc.cnzanyu.com;
  5. proxy_redirect off;
  6. proxy_set_header X-Real-IP $remote_addr;
  7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8. proxy_connect_timeout 60;
  9. proxy_read_timeout 600;
  10. proxy_send_timeout 600;
  11. index index.html index.php index.htm;
  12. }
  13. #START-ERROR-PAGE
  14. #error_page 403 /403.html;
  15. #error_page 404 /404.html;
  16. #error_page 502 /502.html;
  17. #END-ERROR-PAGE
  18. #HTTP_TO_HTTPS_START
  19. #HTTP_TO_HTTPS_END
  20. #LIMIT_INFO_START
  21. #LIMIT_INFO_END
  22. #SSL-INFO-START
  23. #SSL-INFO-END
  24. #反代清理缓存配置
  25. location ~ /purge(/.*) {
  26. proxy_cache_purge cache_one $1$is_args$args;
  27. }
  28. #proxy 反向代理 需关闭!!!!!
  29. #include proxy/cc.test.com/*.conf;
  30. #PHP-INFO-START
  31. include php/73.conf;
  32. #PHP-INFO-END
  33. #REWRITE-START
  34. include rewrite/cc.test.com/*.conf;
  35. #REWRITE-END
  36. #redirect 重定向
  37. include redirect/cc.test.com/*.conf;
  38. #禁止访问的文件或目录
  39. location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|README.md)
  40. {
  41. #return 404;
  42. }
  43. #一键申请SSL证书验证目录相关设置
  44. location ~ \.well-known{
  45. allow all;
  46. }
  47. access_log D:/BtSoft/wwwlogs/cc.test.com.log;
  48. error_log D:/BtSoft/wwwlogs/cc.test.com.error.log;

}

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学