Skip to content

Unable to mount domain.com/url as domain.com/ in Express + Nginx #5813

Closed Answered by IamLizu
TracerDS asked this question in Q&A
Discussion options

You must be logged in to vote

Perhaps its a more nginx problem, could you please try something like,

server {
    listen 80;
    server_name www.my.domain.name.com;

    location /api/ {
        proxy_pass http://localhost:8080/;
        proxy_set_header Host $host;
        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;
    }

    location / {
        # Your other settings for the main website
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TracerDS
Comment options

@IamLizu
Comment options

IamLizu Aug 7, 2024
Collaborator

Answer selected by TracerDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants