0
votes

I'm working locally for the moment.

I have an NGINX configuration for nuxtwoo.example.com. Whenver I visit nuxtwoo.example.com, I need it to proxy localhost:3000, which is working fine, however I also need it to pass the port :300.

location / {
    proxy_pass http://localhost:3000;
}

What I need,

http://nuxtwoo.example.com -> proxy_pass : localhost: 3000 -> URL in browser, nuxtwoo.example.com:3000.

This will also need to for other params, such as nuxtwoo.example.com/blog, should go proxy_pass localhost:3000/blog, and the browser url should be nuxtwoo.example.com:3000/blog.

Can't seem to figure this one out.

1

1 Answers

0
votes

You need to use an upstream

upstream http_backend {
    server 127.0.0.1:8080;

    keepalive 16;
}

server {
    ...

    location /http/ {
        proxy_pass http://http_backend;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        ...
    }
}