I have a nextjs project, which runs at: http://localshot:3001
And what I want is direct the domain of ferajey.com to http://localshot:3001/myblog
MY nginx config is simple:
location / {
# proxy_pass http://127.0.0.1:3001/myblog;
proxy_pass http://127.0.0.1:3001/myblog; # 转发规则
# proxy_set_header Host $host; # 修改转发请求头,让8080端口的应用可以受到真实的请求
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
}
Now the page can shown, but it just down partially, the page title shows, means it actually get the page, but not fully shown.
It’s blank actaully.
I want to learn:
- what’s the right way to using nginx direct a domain to subpath?
- Why my situation is blank?
Any help would be very appreciated!
BTW: http://127.0.0.1:3001/myblog is normal, and if I using another domain direct to root, for example, bbb.com, then bbb.com/myblog is perfect. But I want just feregrey.com directly to myblog page, without any subpath.