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,

Thomas Carlton
  • 145
  • 1
  • 6
  • https://serverfault.com/questions/562756/how-to-remove-the-path-with-an-nginx-proxy-pass – AlexD Jan 30 '21 at 07:06
  • Please add a couple of examples of the original URL and destination URL you would like to have. It is hard to see what "with the suffix" actually means. – Tero Kilkanen Jan 30 '21 at 09:02
  • Your configuration looks correct. Exactly what does this 404 error look like? Did you check your logs? – Michael Hampton Jan 30 '21 at 17:45

0 Answers0