HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 10.10 (http://www.howtoforge.com/forums/showthread.php?t=50215)

SamTzu 25th November 2010 12: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.
/etc/nginx/sites-available/default

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

SamTzu 25th November 2010 12: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 13: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...

Quote:

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

Quote:

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 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
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 09: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...

Quote:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^internet-palvelut.fi$ [NC]
RewriteRule ^(.*)$ http://www.internet-content.net/fi/$1 [L,R=301]

RewriteCond %{HTTP_HOST} !^www.internet-palvelut.fi$ [NC]
RewriteRule ^(.*)$ http://www.internet-content.net/fi/$1 [L,R=301]

falko 27th November 2010 11:39

This link might help: http://wiki.nginx.org/NginxHttpRewriteModule

SamTzu 27th November 2010 21: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 10:39.

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