A critical mistake you should avoid when setting Nginx.conf

You can setup a website using many types of frameworks. But, no matter what framework you use, you always need a web server engine, such as Nginx, Apache, OpenLiteSpeed, etc. This article is gonna talk about one annoying trap in nginx.conf that you never wanna fall into.

Every website has its own resource files, such as js, css, image, html, etc. To let your server response these files to the browser correctly, especially you are using Nodejs, please bear in mind that never add the following codes in nginx.conf, cause it could lead to 404 to every resource file request.

	    location  /resource/css {
			alias /home/XXXX/resource/css/;
			try_files $uri $uri/ = 404;
		}

Add a Comment

Your email address will not be published. Required fields are marked *