Author Topic: HTTP to HTTPS Redirection using NGINX + VARNISH + APACHE  (Read 2509 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
HTTP to HTTPS Redirection using NGINX + VARNISH + APACHE
« on: December 05, 2018, 11:25:55 AM »
Can anyone provide a step by step for configuring HTTP to HTTPS redirection for all sites using NGINX + VARNISH + APACHE.

If you go to a domain using HTTPS directly (by typing https://www.domain.com), the web page shows fine. If you go to the same domain using HTTP directly (by typing http://www.domain.com), you get a 404 error. Previously we were only using Apache and the .htaccess file was happily redirecting. Since setting up NGINX and VARNISH, the function has stopped.

Any advice would be much appreciated.

Offline
*
Re: HTTP to HTTPS Redirection using NGINX + VARNISH + APACHE
« Reply #1 on: December 05, 2018, 12:16:49 PM »
if you still run apache as additional webserver or main today new update is released which has support for https, so basically you do the same like before like you are using apache only, rebuild of webservers or via WebServers Conf is required.

probably the best option to handle this (in wordpress for example) to edit url in the wp-admin.



VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: HTTP to HTTPS Redirection using NGINX + VARNISH + APACHE
« Reply #2 on: January 15, 2021, 01:50:52 PM »
Hi, I know this is an old topic. However, I have installed CentOS7 + CWP (Licenced) with a >>Nginx & Varnish & Apache<< setup.
This is my curl output for HTTP & HTTPS
Code: [Select]
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Fri, 15 Jan 2021 13:35:14 GMT
Content-Type: text/html
Content-Length: 5069
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
Last-Modified: Tue, 24 Jan 2017 21:00:51 GMT
ETag: "13cd-546dd693ee6c0"
Accept-Ranges: bytes
X-Cache: HIT from Backend
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Code: [Select]
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Fri, 15 Jan 2021 13:35:19 GMT
Content-Type: text/html
Content-Length: 5069
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
Last-Modified: Tue, 24 Jan 2017 21:00:51 GMT
ETag: "13cd-546dd693ee6c0"
Accept-Ranges: bytes
X-Cache: HIT from Backend
Strict-Transport-Security: max-age=31536000
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff

Can someone confirm that this output is OK? How can I test this server-side caching to be 100% sure?
I'm asking this because in both cases I see nginx server. Thought that HTTP is going through Apache and nginx resolves SSL
« Last Edit: January 15, 2021, 01:52:48 PM by Ivansmo »