Score:0

nginx reverse proxy configuration - 404 not found

yt flag

I have a react app running on nginx(443) and spring server application(8443). Both are SSL secured. In local everything is working well. The problem is after deploying to dev - thats why I'm pretty sure it;s nginx config issue. Here's my file :

server {
          listen 443 ssl;
   server_name 193.xxx.xx.xxx;

    ssl_certificate nginx.crt;
    ssl_certificate_key nginx.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;


   root /var/www/193.xxx.xx.xx;
   index index.html;

    # Add access log
   access_log /var/log/nginx/access.log;

   # Add error log
   error_log /var/log/nginx/error.log;


      location / {
        proxy_pass  https://193.xxx.xx.xx:8443;
        proxy_ssl_verify off;
        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_connect_timeout 1;
        proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404;
        proxy_intercept_errors on;

        allow all;
     error_page  405     =200 $uri;

        try_files $uri $uri/ /index.html;
    }

        location ~ /.well-known {
                allow all;
}
}

If I remove proxy block everything works well of course except api calls. What am I doing wrong ? I'm stuck.

This is what I receive :

enter image description here

in flag
That's not an nginx error page.
in flag
Does this answer your question? [How to reverse proxy host paths to absolute urls using ngix?](https://serverfault.com/questions/1130766/how-to-reverse-proxy-host-paths-to-absolute-urls-using-ngix/1130780#1130780)
Bartos avatar
yt flag
No :/ I saw this answer but it's not a solution in my case.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.