node.js – 如何从作为nodejs服务器的反向代理的nginx服务器提供静态文件?
发布时间:2020-11-17 01:04:03 所属栏目:Nginx 来源:互联网
导读:我当前的nginx配置是这样的:upstream nodejs { server 127.0.0.1:3000; } server { listen 8080; server_name localhost; root ~/workspace/test/app; index index.html; locat
我当前的nginx配置是这样的:
我对nginx非常新鲜,但至少我知道在提供静态文件时,nginx比node / express更好.如何配置服务器以使nginx提供静态文件? 最佳答案 我用这个新的配置解决了它:
感谢以下堆栈溢出帖子: How to serve all existing static files directly with NGINX,but proxy the rest to a backend server. (编辑:十堰站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- nginx – [emerg] bind()到0.0.0.0:80失败(98:地址已在使用
- Nginx proxy_pass通过https_proxy
- ruby-on-rails – 使用rails,nginx和send_file在Chrome中流
- 简单配置Nginx和Varnish
- apache – Nginx不会离开!如何删除它
- 可以在nginx的上游块中使用“include”指令吗?
- django – gevent-socketio nginx uwsgi不能在开发服务器上
- nginx uwsgi flask重写目录作为app中的基本目录
- Django Gunicorn nginx表现非常糟糕.甚至无法获得8 qps
- linux-用apt-get vs PPA安装Node-有什么区别?
推荐文章
站长推荐
热点阅读