【发布时间】:2018-05-25 18:01:56
【问题描述】:
我正在端口 3000 上运行一个流星应用程序,并希望在 nginx 上将其代理传递给地址 example.com/meteor。
我尝试了以下配置,但失败了。当我使用像 meteor.example.com 这样的子域时,它正在工作。
server {
listen 80;
server_name example.com/meteor www.example.com/meteor;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
}
}
除此之外,我还有一个 default 配置,如下所示:
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/ssl-example.com.conf;
include snippets/ssl-params.conf;
root /var/www/html;
index index.html index.htm index.nginx-debian.html index.php;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
【问题讨论】: