1

I am trying to deploy a nuxt blog to a virtual private server that runs nginx. The blog is supposed to be accessible when I browse to https://exampledomain.com/articles

I have managed to run npm run dev on the server successifully... The app is running on localhost:3000 on the server....

I need to set a reverse proxy on the server to redirect all requests from https://exampledomain.com/articles/ to localhost:3000

I have tried this twice and its failing.... When I browse https://exampledomain.com:3000 the app is loading forever.... when I go to https://exampledomain.com/articles it says "Page not working", or "Internal server error"

Kindly assist

1

1 Answer 1

1

This could be happening due to incorrect configuration.

Try sudo nano /etc/nginx/sites-available/your-domain.com

Remember to change the your-domain.com to your desire domain

server {
    listen 80;
    listen [::]:80;
    index index.html;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.