Hello! I have been running an NGINX server for a bit now, as a reverse proxy and web server. I installed startertab and got it running on my server great, now I am trying to set it up so I do not need to use the 3000 port, IE: https://domain.com/home
Example:
https://domain.com/ <-- works great, as always
http://domain.com/ <-- works great, as always, redirects to HTTPS
https://domain.com/sonarr<-- works great, as always (example of working app)
https://domain.com/home <-- redirects to https://domain.com/
https://domain.com:3000/home <-- ERR_SSL_PROTOCOL_ERROR
http://domain.com:3000/home <-- loads great, but browser notes it is insecure due to lack of HTTPS
https://domain.com/garbageasdadasdasda <-- 404 not found
I am thinking that https://domain.com/home is attempting the URL https://domain.com:3000/home, getting the SSL error, then redirecting to its homepage https://domain.com/ instead. I think it is finding startertab because it does non 404, but redirecting once it gets the SSL error.
Nginx Location Block for startertab:
location /home {
proxy_pass http://localhost:3000/home;
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_set_header X-Forwarded-Host $http_host;
}
Location block for a different app that is working great:
location /sonarr {
proxy_pass http://localhost:8989/sonarr;
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_http_version 1.1;
proxy_no_cache $cookie_session;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
add_header X-Frame-Options "SAMEORIGIN";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location /sonarr/api {
auth_request off;
proxy_pass http://localhost:8989/sonarr/api;
}
}
Nginx Site-enabled file for domain.com.conf
server{
root /var/www/domain.com/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name domain.com;
location / { try_files $uri $uri/ =404; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
location /api/v2 {
try_files $uri /api/v2/index.php$is_args$args;
}
location ~ /organizr-auth/(.*) {
internal;
proxy_pass https://127.0.0.1/api/v2/auth/$1;
proxy_set_header Content-Length "";
}
include conf.d/apps/*.conf; #apps #Uncomment to enable apps
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
fastcgi_buffers 32 32k;
fastcgi_buffer_size 32k;
}
server{
if ($host = domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name domain.com;
return 404; # managed by Certbot
}
Additionally, I have this added to my next.config.js file:
const nextConfig = {
reactStrictMode: true,
basePath: '/home',
}
module.exports = nextConfig
I would love any suggestions on how I can get this working on https://domain.com/home without the SSL error.