Nginx反向代理部署NodeJS项目


在nginx配置文件种的http节点下:

server {
    listen 8005;
    server_name localhost;
    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_pass http://127.0.0.1:3000;
        proxy_redirect off;
    }
}

浏览器输入http://localhost:8005,nginx代理到http://localhost:3000/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM