0

I'm using Nginx to serve a webapp.

I need to reverse proxy all the URL's with the prefix ws

I tried the following Nginx configuration but it's not woking :

server {
        server_name example.com www.example.com;
        listen 80;
        listen [::]:80;
    return 301 https://www.example.com$request_uri;

}

server { listen 443 ssl; server_name example.com www.example.com;

    ssl_certificate     /home/aspuser/ssl/example.crt;
    ssl_certificate_key /home/aspuser/ssl/example.key;

    access_log /var/log/nginx/reverse-access.log;
    error_log /var/log/nginx/reverse-error.log;

    location /ws
            {
                proxy_pass https://localhost:8443;
            }

}

I'm getting the error : HTTP ERROR 404, the page can’t be found.

I'm sure the underlying application is working because when in the config file, if I change the location to simply location / it works. However I need it for the pages with the prefix ws.

Can anyone help please ?

Thanks,

0 Answers0