HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   HOWTO-Related Questions (
-   -   Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 10.10 (

SamTzu 25th November 2010 13:03

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 10.10
There seems to be something wrong/missing with the nginx configuration file.

First page of the Joomla site works fine but all the other pages get
404 Not Found

SamTzu 25th November 2010 13:10

Joomla SEO
Looks like it's a SEO issue. I'm wondering if anyone has a working solution for Joomla's Apache mod_rewrite or .htaccess settings?

SamTzu 25th November 2010 14:34

Almost solved it.

With this nginx config I can have nearly the same functionality than with apache mod_rewrite and .htaccess combination. (+Joomla SEO)

Problem is some components that use 'home' directory feel it is in the wrong place...


The home directory doesn't exist, check your settings. (/usr/local/nginx/html)
Here is the nginx config.


server {

listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
large_client_header_buffers 4 8k;
server_name _;

access_log /var/log/nginx/localhost.access.log;

location / {
try_files $uri $uri/ /index.php?q=$request_uri;
root /var/www;
index index.php index.html;

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /400.html;
location = /400.html {
root /var/www/error;

# proxy the PHP scripts to Apache listening on
#location ~ \.php$ {

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
include fastcgi_params;

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
I can't find that home path defined anywhere.
Maybe it's nginx default?

SamTzu 26th November 2010 10:09

Edit: Looks like this was DNS issue. Forget it... :)

My excursion with nginx has run in to a new difficulty.
So far we have redirected many sites that come with different domain names (.org .net .info etc.) to the main domain site by using ISPConfig's site/option page's handy apache form.

It seems though that if traffic is redirected to a nginx server this will stop working.

hmm... How to overcome the problem?

This is the type of code we have been using to do the redirecting...


Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

falko 27th November 2010 12:39

This link might help:

SamTzu 27th November 2010 22:53

Actually my config above works quite well with Joomla SEO. Only thing still unclear is how to define the 'home' directory that nginx seems to look for.

All times are GMT +2. The time now is 09:02.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.