Ubuntu and Nginx with WordPress - SSL Works but only homepage loads


#1

Please fill out the fields below so we can help you better.

My domain is: fiwebelize.com

I ran this command: n/a
It produced this output: n/a

My operating system is (include version): Ubuntu 16.04.2 LTS

My web server is (include version): nginx version: nginx/1.10.3 (Ubuntu)

My hosting provider, if applicable, is: I host my own

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

I setup LE and got it to where my site actually loads with https:// however, no matter what I try to do, all I can get to is the home page.

I ensured that I:

  • switched both WordPress Address (URL) and Site Address (URL) are https
  • set define('FORCE_SSL_ADMIN', true); in wp-config.php
  • set if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; in wp-config.php

Not sure what to do to ensure I can get to the rest of my site. Please let me know what you need to assist…


#2

You are getting 404 errors which are not to do with SSL or TLS

this is not really a general forum for web server configurations

I suggest you talk to people who may be able to help you on other forums

e.g: http://stackoverflow.com/questions/14460935/nginx-only-shows-welcome-page


#3

Right, however, this only started after I setup the SSL stuff…


#4

… and thanks for the pointer btw… Checking in there as well.


#5

Hi @FiWeBelize

Not picking fights -

Right, however, this only started after I setup the SSL stuff…

this would have been useful to know

  • switched both WordPress Address (URL) and Site Address (URL) are https
  • set define(‘FORCE_SSL_ADMIN’, true); in wp-config.php
  • set if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) $_SERVER[‘HTTPS’]=‘on’; in wp-config.php

can you explain the rationale for these steps? are you following a guide?

can you try your admin page and see if you are getting the same errors (i.e not being able to find contents)

Andrei


#6

also have a look at this plugin https://wordpress.org/plugins/really-simple-ssl/ - it seems to suggest that .HTACESS does need to be udpated

Note: I am not a WordPress expert so can’t gurantee things won’t break :smiley:

Andrei


#7

No worries, not picking fights either and did not see it that way at all.

I was following this: https://codex.wordpress.org/Administration_Over_SSL which noted the wp-config.php items.

For some reason, I got home and now the admin panel loads now, the pages and posts however still do not. I’ll check that plugin out but I have also updated the .htaccess file.

Thanks for all your help.


#8

Looks like there something up with the permalinks… I will keep this thread updated in case another person runs into this issue.

Basically, if I switch my permalinks to Plain things work … As soon as I switch it to Post Name things break…


Migrating WordPress with HTTPs Secured by LetsEncrypt to New Server
#9

Got it sorted out. I followed this tutorial at Let’s Secure Me to setup LetsEncrypt and it was missing a crucial line…

They had the section of the file as:

location / {
    if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }
}

I changed it to:

location / {
    try_files $uri $uri/ /index.php$is_args$args;
    if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }
}

This can be considered resolved. Thanks once again for your assist.


#10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.