<div dir="ltr"><div>Hi guys,</div><div> I am having a jpro.one parsed javafx webpage/app hosted by an nginx server. It is accessible via <a href="http://DOMAIN:8080">http://DOMAIN:8080</a>. This is working as intended. <br></div><div><br></div><div>Now I have configured nginx so that it listens on port 80 and 443, so that,
<a href="http://DOMAINNAME">http://DOMAINNAME</a> -> return <a href="https://DOMAINNAME">https://DOMAINNAME</a> and <a href="https://DOMAINNAME">https://DOMAINNAME</a> -> return <a href="http://localhost:8080">http://localhost:8080</a>, which I want to do.</div><div></div><div><br></div><div>When I enter <a href="http://DOMAINNAME:8080">http://DOMAINNAME:8080</a>, the page works as intended. <br></div><div><br></div><div>When I enter <a href="https://DOMAINNAME:8080">https://DOMAINNAME:8080</a>, I get a warning about a bad certificate, since jpro returns http content, so I suppose it is working as intended. Additional question: Is there a way to get rid of the cert warning? <br></div><div><br></div><div>When I enter <a href="http://DOMAINNAME">http://DOMAINNAME</a> I get redirected to the https page, so working as intended.</div><div><br></div><div>BUT:
When I enter <a href="https://DOMAINNAME">https://DOMAINNAME</a>, it just says the page is not available. I expected to get redirected to <a href="http://localhost:8080">http://localhost:8080</a>.</div><div><br></div><div> My nginx config, checked with nginx -t, is syntax correct but fails to redirect me on https access.
These are my nginx config files in /etc/nginx/conf.d/ I tried:</div><div><br></div><div> - jpro.conf: <br></div><div>``` <br></div><div>proxy_buffering off;</div><div> proxy_set_header X-Real-IP $remote_addr; <br></div><div>proxy_set_header X-Forwarded-Proto $scheme; <br></div><div>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>proxy_set_header Host $http_host; <br></div><div>proxy_set_header Upgrade $http_upgrade; <br></div><div>proxy_set_header Connection "upgrade"; <br></div><div>proxy_read_timeout 86400; <br></div><div>proxy_http_version 1.1;</div><div> ``` <br></div><div>and
-DOMAIN.conf <br></div><div>```</div><div> upstream ppcsc { <br></div><div>server localhost:8080; <br></div><div>}</div><div> server { <br></div><div>listen 80; <br></div><div>server_name DOMAINNAME; <br></div><div>return 301 https://$http_host$request_uri;</div><div>}</div><div> server {</div><div>listen 443 ssl;</div><div>server_name DOMAINNAME; <br></div><div>tcp_nodelay on;</div><div>ssl_certificate FILE.cer;</div><div>ssl_certificate_key FILE.key;</div><div>ssl_protocols TLSv1.3; <br></div><div>ssl_ciphers HIGH:!aNULL:!MD5; <br></div><div># return 301 <a href="http://ppcsc">http://ppcsc</a>; <br></div><div>return 301 http://$http_host:8080$request_uri;</div><div># location / {
# proxy_pass <a href="http://ppcsc">http://ppcsc</a>;
# }
} <br></div><div>```</div><div> Thanks for the help and kind regards , Chris</div></div>