node.js – 如何从作为nodejs服务器的反向代理的nginx服务器提
发布时间:2020-12-13 21:06:59 所属栏目:Nginx 来源:网络整理
导读:我当前的nginx配置是这样的: upstream nodejs { server 127.0.0.1:3000;}server { listen 8080; server_name localhost; root ~/workspace/test/app; index index.html; location / { proxy_pass http://nodejs; proxy_set_header Host $host ; proxy_set_h
我当前的nginx配置是这样的:
我对nginx非常新鲜,但至少我知道在提供静态文件时,nginx比node / express更好.如何配置服务器以使nginx提供静态文件? 最佳答案
我用这个新的配置解决了它:
感谢以下堆栈溢出帖子: How to serve all existing static files directly with NGINX,but proxy the rest to a backend server. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |