【发布时间】:2014-09-17 05:17:32
【问题描述】:
我试图让 nginx 指向我的 index.html 页面以及位于 /var/www/ 之外的 GoPATH 中的 imgs、CSS、JS 等。我的总体目标是让我的网站在端口 80 而不是 8080 上运行。可以这样做吗?以下是我目前在 nginx.conf 中的内容。
user www-data;
http {
include /etc/nginx/proxy.conf;
index index.html
}
server { # simple reverse-proxy
listen 80;
server_name dtrinh.com www.dtrinh.com;
access_log logs/dtrinh.access.log main;
# serve static files
# serve static files
location / {
root /go/src/ps/views/default/index.html;
expires 30d;
# pass requests for dynamic content to rails/turbogears/zope, et al
location / {
proxy_pass http://127.0.0.1:8080;
}
}
【问题讨论】:
-
您只是想提供一个文件吗? “index.html”或整个默认目录。
-
我正在尝试服务整个目录,也就是 ps,其中包含 index.html、css 等。
-
顺便说一句,您在此处发布的配置不正确。第 6 行有一个杂散的 }。
标签: nginx reverse-proxy