我一直在尝试首次设置NGINX,并需要将我的网站的端口从80转发到8080。然而,经过多次尝试后我仍未成功。以下是我最新的尝试:
我按照此处的步骤进行操作:https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3 不同之处在于我的nginx.conf文件包含:
这是正确的文件内容吗?我是否使用了错误的教程?
谢谢!
我按照此处的步骤进行操作:https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3 不同之处在于我的nginx.conf文件包含:
server{
listen 80;
server_name myWebsiteName;
access_log /home/path_to_site/access.log;
error_log /home/path_to_site/error.log;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
这是正确的文件内容吗?我是否使用了错误的教程?
谢谢!