当我尝试运行以下 nginx 配置文件时,出现错误 Cannot GET /index on using http://domain_name/index
。当我点击 时http://domain_name
,它调用 127.0.0.1/3000。我在这里做错了什么。对此的任何帮助都会非常有帮助。
error_log /tmp/logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /tmp/logs/access.log;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/sites-enabled/*;
# BELOW IS THE PART TO PROXY MY samp1.js and samp2.js APP
upstream first_entry {
server 127.0.0.1:3000;
}
upstream second_entry {
server 127.0.0.1:5000;
}
server {
listen 80;
server_name domain_name;
location / {
proxy_pass http://first_entry;
}
location /index {
proxy_pass http://second_entry;
}
}
}