Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Private/Incognito tabs, www.earmilk.com loads non-existent cached fiiles and doesn't forward to non-www #9

Closed
andrebu opened this issue Jan 24, 2016 · 16 comments
Assignees

Comments

@andrebu
Copy link
Collaborator

andrebu commented Jan 24, 2016

In Private/Incognito tabs, www.earmilk.com loads non-existent cached fiiles and doesn't forward to non-www.

This behavior is observed in any browser's "Private" mode.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 24, 2016

Turning off W3 Total Cache seems to fix it. But why?

@andrebu andrebu self-assigned this Jan 24, 2016
@montreyw
Copy link
Owner

Not sure but I've never had complete success with caching stuffs. Its probably the way the caching communicates with the the server and related to file permissions perhaps?

Sent from my iPhone

On Jan 23, 2016, at 6:33 PM, Andre notifications@github.com wrote:

Turning off W3 Total Cache seems to fix it. But why?


Reply to this email directly or view it on GitHub.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 24, 2016

Yeah, I think that's exactly it. It seems W3TC has some issue with
permissions when writing its settings into the nginx.conf (the one at root,
I think).

I'll have this solved soon.


Seriously, with pleasure and optimism,

Andre Bulatov, full stack web developer

w: http://andrebulatov.com
e: contact@andrebulatov.com
m: (732) 261-6638

On Sun, Jan 24, 2016 at 12:44 AM, Montrey Whittaker <
notifications@github.com> wrote:

Not sure but I've never had complete success with caching stuffs. Its
probably the way the caching communicates with the the server and related
to file permissions perhaps?

Sent from my iPhone

On Jan 23, 2016, at 6:33 PM, Andre notifications@github.com wrote:

Turning off W3 Total Cache seems to fix it. But why?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

I think the problem is that though you've made sure to include /etc/nginx/inc/w3tc.conf, that file cannot be edited or updated as W3TC's changes are changed. On top of that, the w3tc.conf file is incomplete
and only contains the "Page Cache cache" and "Browser Cache" blocks. The "Page Cache core" block is missing.

There is also a file named w3tc-pagecache-core.conf which contains the missing block, but that file is not included in the main VHost.

So, I think it's that in /etc/nginx/sites-availabe/earmilk.com.conf this:

     include /etc/nginx/inc/w3tc.conf;

nginx setting was like this...

Needs to point to the nginx.conf file at the WordPress root folder,
where W3TC can update it, like this:

    include /home/www-data/earmilk/public/nginx.conf;

but needs to be like this

I've made the necessary changes but I think an nginx -s reload command
from the user that started the engine (you, @montreyw?) may be in order. ?


Seriously, with pleasure and optimism,

Andre Bulatov, full stack web developer

w: http://andrebulatov.com
e: contact@andrebulatov.com
m: (732) 261-6638

On Sun, Jan 24, 2016 at 6:44 PM, Andre Bulatov andre.bulatov@gmail.com
wrote:

Yeah, I think that's exactly it. It seems W3TC has some issue with
permissions when writing its settings into the nginx.conf (the one at root,
I think).

I'll have it solved soon.


Seriously, with pleasure and optimism,

Andre Bulatov, full stack web developer

w: http://andrebulatov.com
e: contact@andrebulatov.com
m: (732) 261-6638

On Sun, Jan 24, 2016 at 12:44 AM, Montrey Whittaker <
notifications@github.com> wrote:

Not sure but I've never had complete success with caching stuffs. Its
probably the way the caching communicates with the the server and related
to file permissions perhaps?

Sent from my iPhone

On Jan 23, 2016, at 6:33 PM, Andre notifications@github.com wrote:

Turning off W3 Total Cache seems to fix it. But why?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@montreyw
Copy link
Owner

Nginx reloaded!

Montrey Whittaker
Co-Founder / President

www.earmilk.com http://www.earmilk.com/
www.twitter.com/earmilk http://www.twitter.com/earmilk

www.facebook.com/earmilk http://www.facebook.com/earmilk
www.instagram.com/earmilkdotcom http://www.instagram.com/earmilkdotcom

On Sun, Jan 24, 2016 at 9:31 PM, Andre notifications@github.com wrote:

I think the problem is that though you've made sure to include
/etc/nginx/inc/w3tc.conf, that file cannot be edited or updated as W3TC's
changes are changed. On top of that, the w3tc.conf file is incomplete
and only contains the "Page Cache cache" and "Browser Cache" blocks.
The "Page Cache core" block is missing.

There is also a file named w3tc-pagecache-core.conf which contains the
missing block, but that file is not included in the main VHost.


So, I think it's that in /etc/nginx/sites-availabe/earmilk.com.conf this:

include /etc/nginx/inc/w3tc.conf;

[image: Inline image 1]

Needs to point to the nginx.conf file at the WordPress root folder,
where W3TC can update it, like this:

include /home/www-data/earmilk/public/nginx.conf;

[image: Inline image 2]

I've made the necessary changes but I think an nginx -s reload command
from the user that started the engine (you, @montreyw?) may be in order. ?


Seriously, with pleasure and optimism,

Andre Bulatov, full stack web developer

w: http://andrebulatov.com
e: contact@andrebulatov.com
m: (732) 261-6638

On Sun, Jan 24, 2016 at 6:44 PM, Andre Bulatov andre.bulatov@gmail.com
wrote:

Yeah, I think that's exactly it. It seems W3TC has some issue with
permissions when writing its settings into the nginx.conf (the one at
root,
I think).

I'll have it solved soon.


Seriously, with pleasure and optimism,

Andre Bulatov, full stack web developer

w: http://andrebulatov.com
e: contact@andrebulatov.com
m: (732) 261-6638

On Sun, Jan 24, 2016 at 12:44 AM, Montrey Whittaker <
notifications@github.com> wrote:

Not sure but I've never had complete success with caching stuffs. Its
probably the way the caching communicates with the the server and
related
to file permissions perhaps?

Sent from my iPhone

On Jan 23, 2016, at 6:33 PM, Andre notifications@github.com wrote:

Turning off W3 Total Cache seems to fix it. But why?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
<
#9 (comment)

.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

Why is Markdown so goofy in these GitHub comments? Sometimes it works, sometimes it doesn't...

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

I just verified in Chrome, Safari and Chrome, all in private mode, and "www.earmilk.com" properly redirects to "earmilk.com" with the latest PHP and CSS files, the first time, and every time.

Please verify and confirm on your end and close issue if all is well.

@andrebu andrebu assigned montreyw and andrebu and unassigned andrebu and montreyw Jan 25, 2016
@montreyw
Copy link
Owner

The redirect works but if you click any links you get 404

@montreyw
Copy link
Owner

Error log shows:
2016/01/24 04:01:56 [error] 686#0: *6254614 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 66.249.64.18, server: www.earmilk.com, request: "GET /2013/12/23/amerie-1-thing-tastytreat-x-hexes-remix-download/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:56 [error] 691#0: *6254709 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 8.21.199.12, server: www.earmilk.com, request: "GET /2013/07/17/dash-berlin-alexander-popov-steal-you-away-feat-jonathan-mendelsohn/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:56 [error] 691#0: *6254711 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 141.8.143.188, server: www.earmilk.com, request: "GET /2016/01/12/jarami-remix-chinahs-we-go-back-and-cop-a-verse-from-skizzy-mars/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:56 [error] 691#0: *6254716 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 68.180.229.27, server: www.earmilk.com, request: "GET /2015/01/21/arno-cost-norman-doray-team-up-once-again-on-paradisco-featuring-ben-macklin-download/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:56 [error] 691#0: *6254718 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 8.21.199.12, server: www.earmilk.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:57 [error] 691#0: *6254720 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 17.142.159.162, server: www.earmilk.com, request: "GET /2015/09/15/shaq-gets-ready-tomorrowworld-chain-smokers-video-contest-news/?utm_term=%23Music&utm_source=twitterfeed&utm_medium=twitter HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:01:59 [error] 686#0: *6254614 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 66.249.64.18, server: www.earmilk.com, request: "GET /2011/09/18/casey-veggies-%E2%80%93-i-be-over-shit-prod-hit-boy-video/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"
2016/01/24 04:02:00 [error] 686#0: *6254614 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for get_page_uri(), called in /home/www-data/earmilk/public/wp-content/themes/mag-wp/header.php on line 52 and defined in /home/www-data/earmilk/public/wp-includes/post.php on line 4283" while reading response header from upstream, client: 66.249.64.18, server: www.earmilk.com, request: "GET /2015/03/04/oh-wonder-shares-insight-to-their-massively-popular-project-interview/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "earmilk.com"

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

I've removed previous W3TC settings from the VHost. Please try another reload.

@montreyw
Copy link
Owner

Done. Should we turn on W3TC again or?

Montrey Whittaker
Co-Founder / President

www.earmilk.com http://www.earmilk.com/
www.twitter.com/earmilk http://www.twitter.com/earmilk

www.facebook.com/earmilk http://www.facebook.com/earmilk
www.instagram.com/earmilkdotcom http://www.instagram.com/earmilkdotcom

On Sun, Jan 24, 2016 at 10:17 PM, Andre notifications@github.com wrote:

I've removed previous W3TC settings from the VHost. Please try another
reload.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@andrebu andrebu reopened this Jan 25, 2016
@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

Ok, so first things first, those errors in the log are from yesterday it seems, around 4am on the 24th. I don't think they're related. Also, I know what they are referring to and I've just fixed that issue -- it was basically nothing.

The one thing I did notice about those errors in the log, and this may be inconsequential, but the error log refers to the site as "server: www.earmilk.com"...

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

I am not yet sure what the 404s were caused by -- my theories are either (a) stray W3TC settings in VHost, or (b) my inclusion of the correct nginx.conf file (not sure why that would be though).

Before your last "nginx reload," I not only removed the stray code from VHost but I also commented out the inclusion line for W3TC. W3TC is now on, but I don't think it is working. Also all redirection seems to be working fine. My guess though, is that W3TC is simply not working, hence redirection works and no 404s.

I'm gonna need to try to un-comment that and for you to reload again.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

I think it may also have been that (c) in "W3TC -->> General Settings -->> Miscellaneous," the path was to '/etc/nginx/sites-available/earmilk.com.conf,' which is not write-able (but still had some stray W3TC settings).

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 25, 2016

When we finish this, an additional

location = /nginx.conf {
    deny all;
}

may be prudent.

@andrebu
Copy link
Collaborator Author

andrebu commented Jan 26, 2016

  1. I backed up W3TC's settings and uninstalled it.
  2. New NGINX entry for W3TC in main VHost:

screen shot 2016-01-25 at 11 44 48 pm

` # Include W3TC's editable nginx.conf file in WordPress root include /home/www-data/earmilk/public/nginx.conf; ` 3. I try a reload : Verified that it is not the entry itself or some settings in W3TC's old nginx.conf. NGINX refuses. See what it said:

screen shot 2016-01-25 at 11 46 32 pm

# nginx -s reload                                                            
nginx: [emerg] open() "/home/www-data/earmilk/public/nginx.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/earmilk.com:26

So it's only complaint at this point is that the file is missing.
4. I reinstall W3TC fresh -- it creates a new nginx.conf that is simply like this:
screen shot 2016-01-25 at 11 49 15 pm

# BEGIN W3TC Browser Cache
gzip on;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
# END W3TC Browser Cache
  1. I do a reload again, successfully, and everything works. I verified all browsers, private windows, www.earmilk.com and earmilk.com, and clicked on several links and everything seems to work.

Please confirm when you get a chance and reopen the issue if you see any of the same behaviors (eg, site-wide 404s except for homepage).

What we really need to work on it seems, is careful configuration of W3TC. Ie, there is no bug in the main VHost anymore, and W3TC is turned on and working with minimal settings.

andrebu pushed a commit that referenced this issue Jan 26, 2016
This is an `include` to W3TCs edit-able nginx.conf file at WP-root.
Now all settings can be dynamically configured from W3TC’s WP-backend
admin panel.
The issue was not with my new `include` reference to W3TC’s editable
nginx.conf, at WordPress root, in the main VHost, but with W3TC
settings themselves as they were in its old nginx.conf file.  This
fixes #9 but we still need to configure W3TC to work optimally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants