U
U
Uniq2015-08-10 14:18:46
Nginx
Uniq, 2015-08-10 14:18:46

How to solve Wordpress https issue on nginx + apache hosting?

I installed wordpress on http hosting in nginx, it is forcibly redirected to https, but links in http still remain, js, css, img, etc. are not loaded. where can I replace http with https in the engine itself?
And if I put in the WordPress Address (URL): https:// then the admin panel does not open in general, although in wp-config.php I registered the SSL permission for the admin panel define( 'FORCE_SSL_ADMIN', true );

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tagplus5, 2016-08-31
@tagplus5

I have this:
one docker container with wordpress and apache
the second docker container with nginx
1) in the WP settings I change the site address from https
2) dump the database, change all links to https, upload the dump back
3) add wp-config define('FORCE_SSL_ADMIN', true);
4) to wp-config change

// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact
// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy
//if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
        $_SERVER['HTTPS'] = 'on';
//}

Everything works on https.

M
marenkov, 2016-03-09
@marenkov

The problem is that the HTTPS request is received by Nginx and then forwarded to Apache via HTTP. Your CMS receives a regular HTTP request and generates regular links.

T
TyzhSysAdmin, 2015-08-10
@POS_troi

Logs, configs, Apache, Nginx.
In WP, the address is set in two constants
WP_HOME and WP_SITEURL
In articles, links can be quickly replaced using WP-cli or https://github.com/interconnectit/Search-Replace-DB
З.Ы. Why do you need Apache in this bunch?

O
Odmikes, 2018-01-29
@Odmikes

Please check it out:
https://enjoyweb.net/moving-to-https-on-wordpress/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question