我在尝试为Nginx安装程序设置第二组位置时遇到问题。我目前有1条工作路线,该路线使用到NodeJS Express服务器的反向代理。
我正在尝试设置第二个位置来服务laravel项目,这是我的Nginx配置文件,我知道有一些错误,但是在谷歌搜索后,我自己找不到答案。
谢谢
server {
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name some.server.com
ssl on;
ssl_certificate /etc/letsencrypt/live/some.server.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/some.server.com/privkey.pem;
# This doesnt work,its a laravel project
# Theres something wrong with my try_files
location /project2 {
root /home/ubuntu/project2/public/;
try_files $uri $uri/ /index.php?$query_string;
}
# This works,I am reverse proxying to NodeJS Application
location / {
proxy_pass http://localhost:3001;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}