域名无法直接访问,报504 Gateway Time-out,必须域名加8081端口才可以访问到,用ip也是一样的结果。关于8081端口我是在阿里云控制台添加了安全组才能访问此端口的。求助!!!
upstream imooc { server 172.0.0.1:8081; } server { listen 80; server_name fc.soecode.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_pass http://imooc; proxy_redirect off; } }
这个是我看阿里云社区里的配置,试了也不行....参考了很多配置,发现都是这样的,可是为啥会报504 ,不起效果呢
server { server_name fc.soecode.com; listen 80; location / { proxy_pass http://172.0.0.1:8081; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }