I got a React application and a Spring Boot application which works very well on the same server with one on port 8080 and other on 3000 but when I try to add SSL certificate to nginx it doesn’t accept my requests but it works well on http and I can access to the application via server IP so how can I install SSL certificate gotten from LetsEncrypt to my server ?
server {
listen 80;
server_name ######;
location / {
root /var/www/appFrontend;
try_files $uri /index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:8080/;
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_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
}
It works well with a config like this but on http. I also user spring security for the backend it may cause the problem also because it works well with http but when I change to https then it gives me the 403 Forbidden error and it also produces pre-authenticated entry point error.
Göktürk Kurucan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.