I am trying to setup a “landing page” (index.html) via HTTPS NGINX so when users hit http://my.site.com they are forwarded to https://my.site.com (and that works fine). However, in this landing site I would like to have links to app1, app2, app3 (just simple HTML tags) so that a user can hit https://my.site.com/app1 and proxy over to app1 running on port 8501 or hit app2/ running on port 8502 etc…
The problem I face is that when I go to https://my.site.com/app1 I get a bunch of 404 Not Found.
This is my NGINX config and I’m wondering where my problem is
server {
listen 80;
server_name my.site.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name my.site.com;
root /var/www/my.site.com;
ssl_certificate /shared/ssl/certs/my.site.com.crt;
ssl_certificate_key /shared/ssl/certs/my.site.com.key;
proxy_http_version 1.1;
ssl_protocols SSLv3 TLSv1.2 TLSv1.3;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
location /app1 {
proxy_pass http://127.0.0.1:8501/;
}
location /app2 {
proxy_pass http://127.0.0.1:8502/;
}
}
Does anyone know what I am missing?