SSL on app - nginx web server

Posted by Adam on Server Fault See other posts from Server Fault or by Adam
Published on 2014-08-19T04:36:27Z Indexed on 2014/08/19 10:22 UTC
Read the original article Hit count: 200

Filed under:
|
|

I am running an nginx web server where I redirect all http requests to https (with a self signed cert).

Here is how I REDIRECT all http requests to https in the nginx config file:

server { 
listen 80 default_server; 
listen [::]:80 default_server ipv6only=on; 
server_name my.server.ip; 
return 301 https://$server_name$request_uri;

Problem is - I cannot seem to do so for an app running on a port. Example:

http://my.server.ip:1234 does not redirect to https://my.server.ip:1234

ir works fine on all other urls like http://my.server.ip/temp etc.

How can I modify the nginx config file to force that app url through ssl?

© Server Fault or respective owner

Related posts about nginx

Related posts about webserver