I recently configured nginx for my server. The server displayed the output of the phpinfo() command containing information from my PHP installation when I enter the IP address in the browser. Now for some reason I am receiving the following error and the page will not not display:
404 Not Found
nginx/1.2.1
Any ideas on how to fix please?
|
You'll need to use the equivalent of mod_rewrite for Nginx. For more information, see: http://www.boonex.com/trac/dolphin/wiki/TutorialHowToInstallDolphinOnNginx BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
Not sure I followed. Did you have a php info file, say, phpinfo.php with phpinfo() in it and it use to work but you are now getting a 404? If so, you need to focus on PHP config. As you know, php does not run as a mod like in Apache. Wait, let me ask you this, does other php files run properly?
Does PHP own the files?
Geeks, making the world a better place |
Yes to all @Geek_Girl. Also in what file should I place the mod_rewrite rules for Nginx in? Also what file should I place the following bit of code in (THANK YOU ALL FOR YOUR HELP):
Some more optimisation is possible, add these lines to http { clause of Nginx configuration file to enable on the fly compression:
gzip_http_version 1.1;
gzip_min_length 200;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
|
The way I handled the mod-rewrites for Dolphin was to place the rewrites in a conf file, dolphin_rewrites.conf and then use an include to load the conf into the server part of the NginX configuration files for your Dolphin site. The location will depend on where you have the rewrite config file, I place the rewrite in the same location the nginx config file was hosted. However, if you are setting up the sites available and sites enabled, then you might want to place the dolphin rewrite in the same directory for the Dolphin site under sites available (the site enable directory contains symbolic links to the sites available). Say that under sites enable you have dolphin and in that directory you have the server config file for your dolphin site, then place the dolphin rewrites config file in that directory as well. When I set up my Dolphin site, I was only thinking of one site on the server, so I simply hard coded the server config into the Nginx conf file. Geeks, making the world a better place |
The gzip will go into the http section of the NginX configuration file and thus will be available to all sites running on the server. Here is an example of the http section of NginX config.
http { include mime.types; default_type application/octet-stream;
index index.html index.htm index.php;
sendfile on; #tcp_nopush on; client_max_body_size 200M;
keepalive_timeout 65;
gzip_http_version 1.1; gzip_min_length 200; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_buffers 16 8k;
Geeks, making the world a better place |
Thank you Geek_Girl. You are the best. |