VPS侦探论坛

 找回密码
 注册
查看: 4387|回复: 1

lnmp 反向代理如何配置???

[复制链接]
发表于 2018-4-6 12:24:16 | 显示全部楼层 |阅读模式

请问nginx反向代理其他网站如何配置,总是提示404




  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name abc.com www.abc.com;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         #root  /home/wwwroot/abc.com;

  8.         include none.conf;
  9.         #error_page   404   /404.html;

  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  12.         include enable-php.conf;


  13.         location / {
  14.             proxy_pass   http://example.com/;#要代理的url
  15.                 index  index.html index.htm;
  16.         }
  17.         #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  18.         #{
  19.         #    expires      30d;
  20.         #}

  21.         #location ~ .*\.(js|css)?$
  22.         #{
  23.         #    expires      12h;
  24.         #}

  25.         #location ~ /.well-known {
  26.         #    allow all;
  27.         #}

  28.         #location ~ /\.
  29.         #{
  30.         #    deny all;
  31.         #}

  32.         access_log off;
  33.     }
复制代码

[ 本帖最后由 bobofan1995 于 2018-4-6 12:50 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-4-6 13:44:54 | 显示全部楼层


https://www.vpser.net 上搜索反向代理 就有教程
弄个反代你加上include enable-php.conf;干啥
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-24 09:19 , Processed in 0.026122 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表