Fiddler Error 504 - While loading CSS file over external IP - css

Our styles and Javascript files are deployed to a central location (CDN). My host file looks like this:
internalIP boxname
externalIP a-record of the website
Now when I try to access a css file(160 kb) using the box name it works fine. However when I try to access the same css file using the a-record of the website, I get an Error 101 (err_connection_reset) in Chrome. The same request in Fiddler gives me a 504. Not sure whats going on. However files that are 20-30kb in size seem to work fine over both the internal and external IP.
IIS log file shows a status code of 200, even when it fails.
Please let me know if my question makes sense. If not I can explain better.

Related

Codekit 3 - External Server Issue

I've been using codekit for ages now, and now I've been using the version 3 since it came out.
I really like this app, but there's something I never really understood and I decided to post it here (hoping to finally understand how this works and how to make it works like I want).
I have MAMP pro installed, with some hosts.
Let's say I have this list of hosts with (fake) document root:
localhost -> documents/site1/dist
test -> documents/sitetest/dist
and let's assume that test is a wordpress site having the site url set to
http://test/ in the database.
In codekit, when I enable the browser refresh, the bottom options asks me to write down the address I would visit to see my website.
Now, if I navigate to http://test/ my WordPress website loads and I am able to see everything.
In codekit I then setup the browser refreshing options to be the following:
Animation: ticked
Refresh Delay: 0.0 seconds (default)
Preview: empty
Document-Root Subpath: empty
External Server Required: on
External Server Address: http://test/
Then when I click on the green dot (server) to preview my website, I'm expecting codekit to navigate to http://test:5757 and to properly display my website. This, unfortunately, is not the case. When I click on the preview (or server, it doesn't really make any difference for me) codekit navigates to my mac IP and the website is either not loading or loading without any external resource.
I don't think the issue is in the way I load the resource in WordPress (i use enqueue sources properly, and the website without using codekit refresh function works, load and displays as meant to).
So far, I always switched my current project to use the localhost host (changing the document root in MAMP pro) and then telling codekit to use the localhost ip as external server, but now it's a bit more complex, as I have way more projects and I was hoping not to change back and forth the document root to use codekit built in refreshing feature.
Is it possible? am I missing something here?
I read all I was able to find as well as watched the videos on codekit, but this bit here is still a bit unknown to me and any help would be really appreciated.
Thanks
PS: No need to mention I am on a MAC, right? :)
I don't believe I actually managed to fix this.
I'll leave the answer here in case somebody else is facing the same issue.
The problem I had was that my website http://test/ was using a theme called test.
Codekit, for refreshing the browser, uses a simple string search and replace in the URL, and so everything that looked like "test" in the url was replaced by the internal ip.
Quick example:
http://test/wp-content/themes/test/index.php
became
http://192.168.0.1:5757/wp-content/themes/192.168.0.1:5757/index.php
and of course no file where loaded successfully, as the path was wrong.
To fix this?
Just change the MAMP pro address to something that won't be present in the URL (in my case, the MAMP pro host called test became dev.test and problem solved.

CloudFlare, Nginx, error 520 accessing PDF file

We just added our website to CloudFlare and everything runs smoothly till now.
When I'm trying to access a pdf file using the absolute path cloudflare returns error 520, this used to work before cloudflare
does anyone know what can break this?
any nginx tweaks needed?
The "520" error is not a standard status code.
You can troubleshooting the issue with cloudflare support, check here:
https://support.cloudflare.com/hc/en-us/articles/200171936-Error-520-Web-server-is-returning-an-unknown-error

403 Forbidden when requesting image from server

I have a static resource image on my static server (http://static.coderichard.com/) which I want to use for a Journal Skin which I'm designing on DeviantArt. But when the image is loaded, I got a 403 Forbidden error.
The image is loaded through CSS like so:
background-image: url('http://static.coderichard.com/img/intrvi-journal-skin-bg.png');
When I tried the exact same thing in JSFiddle, it worked fine. I can also load the image through the browser.
Checking error logs yielded no information and the directory the image is in has 755 permission.
Why am I getting this error and how can I fix it?
I read the following thread, having the same issue as me: http://ubuntuforums.org/showthread.php?t=2167595
The solution was to disable the hotlink protection via .htaccess, but I don't have a .htaccess file there so it makes no sense to try that.
My server is CloudFlare protected and uses Hotlink protection. What I did to fix it was add a directory called hotlink-ok and I put all my resources there which were okay to hotlink.
Try setting a referer with a commannd-line client. If it immediately 403s again, find where your "hotlink protection" is implemented.

Styling not loading when implemented on server

When running my website locally (via yesod devel) the styling loads up and all is good.
CSS files are loaded correctly. Using this method
But when uploaded onto my amazon ec2 server styling is not loaded correctly.
I'm using nginx that listens to port 80, then redirects it to port 3000 where my yesod webapp is running. My nginx.conf settings.
So I can directly got to header.css showing that the static files are passed on to the user browser. However, for some reason the css is not connecting correctly.
Another thing I've noticed is that if I directly go to the IP and port 3000, the default favicon.ico icon will get loading, whereas if I go to the domain it will not get loaded.
Any ideas?
Does the approot setting in config/settings.yml agree with the start of the url you were using to access the ec2 server? The log you show could certainly be explained by it being wrong. Yesod builds in fully qualified urls, using the approot as the prefix, for all of the additional pieces needed to build up a page. (Check the page source to see what Yesod has produced.)
If you are running using yesod devel for now, the approot setting will be the one set for the "Development" environment - which will be the one in the "Defaults" section if you have kept the structure of settings.yml as it was when you created your scaffolded site.
Found nothing seriously wrong on your nginx.conf file.
I hit http://www.finance-web.biz/static/css/header.css and the result is fine.
/*!
* Extra header style
*/
.beta {
color: #CC3300;
}
Maybe it's something cached in your browser.

XAMPP wordpress on localhost

I have this site and I need to test it out locally to see if there is an issue with my php settings, anyways I tried to navigate to localhost with the port number localhost:portnumber
and that worked fine, but then I tried to navigate to my site localhost:portnumber/mysite and I get a 404 error and the in the the address i navigate to changes to localhost:portnumber/mysite
Why is this happening and what can I do to fix it?
Thanks
Because you are getting a 404 error, your server seems to be running but make sure the server is the one you have setup.
1st, have you tried using a simple html file? example: blabla.html on root, and typing: localhost:portnumber/blabla.html
If this is working, that means your server is running fine, you can also try with an Hello world php file if you wish.
In the case of wordpress, there is sometime a .htaccess file that uses url rewrite and it may remove your port number, you could try to test with a clean wordpress install first.

Resources