We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to install Oxwall with Nginx? | Forum

Kevin
Kevin Nov 18 '13
Im facing 404 issue when install.


I think it should be the mod_rewrite issue.


My dedicated server is running on Nginx


What should I put in the server {} ?


How can I check if mod_rewrite is working?


How do I install oxwall at Nginx?


thanks

The Forum post is edited by Kevin Nov 18 '13
Kevin
Kevin Nov 18 '13
Omg... It is working now, I have to shut down nginx and restart it... the restart thing is not working... I hate rewrite!!
fbkca
fbkca Nov 18 '13
Can you give me some tips on getting it working... I must be missing some re-writes as I get a lot of broken images...
Kevin
Kevin Nov 18 '13
I have not try the images yet, i will let you know


I put in the rewrites rules at the .conf server{}

Kevin
Kevin Nov 19 '13
You have to put this code into nginx rewrite .conf server {}


if ($uri !~ "^/index.php"){set $rule_0 1$rule_0;}if ($uri !~ "/ow_updates/index.php"){set $rule_0 2$rule_0;}if ($uri !~ "/ow_updates/"){set $rule_0 3$rule_0;}if ($uri !~ "/ow_cron/run.php"){set $rule_0 4$rule_0;}if ($uri ~ "(/|.php|.html|.htm|.xml|.feed|robots.txt|.raw|/[^.]*)$"){set $rule_0 5$rule_0;}if ($rule_0 = "54321"){rewrite /(.*) /index.php;}


fbkca
fbkca Nov 19 '13
Can you edit that and format it? Pasting in these forums rarely works...


So is your all working now?


Can you post your config(s)?

Kevin
Kevin Nov 19 '13
if ($uri !~ "^/index.php"){set $rule_0 1$rule_0; }
if ($uri !~ "/ow_updates/index.php"){set $rule_0 2$rule_0; }
if ($uri !~ "/ow_updates/"){set $rule_0 3$rule_0; }
if ($uri !~ "/ow_cron/run.php"){set $rule_0 4$rule_0; }
if ($uri ~ "(/|.php|.html|.htm|.xml|.feed|robots.txt|.raw|/[^.]*)$"){set $rule_0 5$rule_0;}if ($rule_0 = "54321"){rewrite /(.*) /index.php; }


it looks like it is working, i uploaded an image and it is good

fbkca
fbkca Nov 19 '13
I don't have a rewrite.conf... what version of nginx are you using? I understand everything goes into a separate mysite.conf using location / { settings  } ???


fbkca
fbkca Nov 19 '13
what are you using to parse your php?
fbkca
fbkca Nov 19 '13
Ok I think I got it now...
Kevin
Kevin Nov 19 '13
I am using the virtualmin that my friend set me up, I am not a server guy I google my way in


/etc/nginx/site/"yoursite"


put inside "server { ***Put anywhere HERE*** }"


Nginx version 1.0.15

fbkca
fbkca Nov 19 '13
right ok, so this is what I have for a working config (replacing 24.5.6.7 with your server's IP):


server {

        root /var/www/mysite;

        listen 24.5.6.7:80;

        server_name www.mysite.com;

        access_log /var/log/nginx/mysite.org.access.log;


if ($uri !~ "^/index.php"){set $rule_0 1$rule_0; }

if ($uri !~ "/ow_updates/index.php"){set $rule_0 2$rule_0; }

if ($uri !~ "/ow_updates/"){set $rule_0 3$rule_0; }

if ($uri !~ "/ow_cron/run.php"){set $rule_0 4$rule_0; }

if ($uri ~ "(/|.php|.html|.htm|.xml|.feed|robots.txt|.raw|/[^.]*)$"){set $rule_0 5$rule_0;}if ($rule_0 = "54321"){rewrite /(.*) /index.php; }


        location ~ \.php {

                fastcgi_split_path_info ^(.+\.php)(.*)$;

                #fastcgi_pass backend;

                fastcgi_pass 127.0.0.1:9000;

                fastcgi_index index.php;

                fastcgi_param SCRIPT_FILENAME /var/www/mysite$fastcgi_script_name;

                include fastcgi_params;

                fastcgi_param QUERY_STRING $query_string;

                fastcgi_param REQUEST_METHOD $request_method;

                fastcgi_param CONTENT_TYPE $content_type;

                fastcgi_param CONTENT_LENGTH $content_length;

                fastcgi_intercept_errors on;

                fastcgi_ignore_client_abort off;

                fastcgi_connect_timeout 60;

                fastcgi_send_timeout 180;

                fastcgi_read_timeout 180;

                fastcgi_buffer_size 128k;

                fastcgi_buffers 4 256k;

                fastcgi_busy_buffers_size 256k;

                fastcgi_temp_file_write_size 256k;

        }


}

Kevin
Kevin Nov 19 '13
yea something like that, and than restart your nginx web server


is that working for you now?

fbkca
fbkca Nov 20 '13
yes, thanks!
fbkca
fbkca Nov 20 '13
The only problem I've found is that there is no access to the sitemap files...


sitemap-1.xml

sitemap.xml



fbkca
fbkca Nov 20 '13
I made these changes to allow them:


if ($uri !~ "^/index.php"){set $rule_0 1$rule_0; }

if ($uri !~ "/ow_updates/index.php"){set $rule_0 2$rule_0; }

if ($uri !~ "/ow_updates/"){set $rule_0 3$rule_0; }

if ($uri !~ "/ow_cron/run.php"){set $rule_0 4$rule_0; }

if ($uri !~ "^/sitemap.xml"){set $rule_0 5$rule_0; }

if ($uri !~ "^/sitemap-[0-255].xml"){set $rule_0 6$rule_0; }

if ($uri ~ "(/|.php|.html|.htm|.xml|.feed|robots.txt|.raw|/[^.]*)$"){set $rule_0 7$rule_0;}if ($rule_0 = "7654321"){rewrite /(.*) /index.php; }

The Forum post is edited by fbkca Nov 20 '13