Welcome! Log In Create A New Profile

Advanced

redirect from http (port 80) to https (port 443) not working.

June 15, 2020 01:02PM
Hi,

I am running nginx version: nginx/1.16.1 on CentOS Linux release 7.8.2003
(Core). When I hit https://marketplace.mydomain.com it works perfectly fine
whereas when I hit http://marketplace.mydomain.com (port 80) does not get
redirected to https://marketplace.mydomain.com (port 443). I have the below
nginx.conf.

server {
> listen 443 ssl default_server;
> #listen 80 default_server;
> #server_name _;
> server_name marketplace.mydomain.com;
> ssl_protocols TLSv1.2;
> ssl_certificate /etc/ssl/certs/
> marketplace.mydomain.com/fullchain1.pem; ssl_certificate_key
> /etc/ssl/certs/marketplace.mydomain.com/privkey1.pem;
> if ($scheme = http) { return 301 https://$server_name$request_uri;
> }
> ssl_ciphers
> ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
> ssl_prefer_server_ciphers on;
> ssl_dhparam /etc/ssl/certs/marketplace.mydomain.com/dhparam.pem;
> client_max_body_size 100M;
> root /var/www/drupal/marketplace-v2/mpV2/web;
> access_log /var/log/nginx/access.log;
> error_log /var/log/nginx/error.log;
> # Load configuration files for the default server block.
> include /etc/nginx/default.d/*.conf;
> location = /favicon.ico {
> log_not_found off;
> access_log off;
> }


I will appreciate it if someone can pitch in for help. Please let me know
if you need any additional configurations and I look forward to hearing
from you. Thanks in Advance.

Best Regards,

Kaushal
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

redirect from http (port 80) to https (port 443) not working.

kaushalshriyan June 15, 2020 01:02PM

RE: redirect from http (port 80) to https (port 443) not working.

Reinis Rozitis June 15, 2020 02:22PM

RE: redirect from http (port 80) to https (port 443) not working.

Reinis Rozitis June 15, 2020 02:26PM

Re: redirect from http (port 80) to https (port 443) not working.

kaushalshriyan June 16, 2020 08:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready