• Support
  • Redirect HTTP to HTTPS with NGINX

Hello,

It seems there are several custom Nginx settings by Wordops.

1# In the /etc/nginx/sites-available/myiste.com:


server {

    # Uncomment the following line for domain mapping
    # listen 80 default_server;

    server_name mysite.com *.mysite.com;

    # Uncomment the following line for domain mapping
    #server_name_in_redirect off;

    access_log /var/log/nginx/lovcour.com.access.log rt_cache;
    error_log /var/log/nginx/lovcour.com.error.log;

    root /var/www/lovcour.com/htdocs;
   
    index index.php index.html index.htm;

    include common/wpfc-php81.conf;
    include common/wpcommon-php81.conf;
    include common/locations-wo.conf;
    include /var/www/lovcour.com/conf/nginx/*.conf;

}

2# But ports is defined in /var/www/mysite.com/conf/nginx/ssl.conf:


listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate     /etc/letsencrypt/live/mysite.com/fullchain.pem;
ssl_certificate_key     /etc/letsencrypt/live/mysite.com/key.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mysite.com/ca.pem;
ssl_stapling_verify on;

3# There is also a default file in the directory etc/nginx/sites-availabe.

I was got lost, how should I set "Redirect HTTP to HTTPS with NGINX" please? which file should I touch please?

Thanks so much.

14 days later

You don't need to configure the redirect, WordOps does it for you in /etc/nginx/conf.d/force-ssl-site.tld.conf

    a month later

    JuanMaia Great thanks, and sorry for missing your reply.

    In my case, I note there is configration file of force-ssl-lovcour.com.conf.disabled.

    Does that mean it was already disabled?
    What might be cause it to be disabled?
    What is the command line to enable it properly in Wordops please?

    Thanks

    Hosted by VirtuBox