Hi all I am trying to convert the following .htaccess code
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^arrowchat/chatroom ^/chatroom/ [L] RewriteRule ^arrowchat/cron ^/cron/ [L] RewriteRule ^arrowchat/debug ^/debug/ [L] RewriteRule ^arrowchat/list ^/list/ [L] RewriteRule ^arrowchat/mobile ^/mobile/ [L] RewriteRule ^arrowchat/popout ^/popout/ [L] RewriteRule ^arrowchat/video ^/video/ [L] </IfModule> This is what I came up with
if ($rule_0 = "2"){ rewrite ^/arrowchat/chatroom ^/chatroom/ last; } rewrite ^/arrowchat/cron ^/cron/ last; rewrite ^/arrowchat/debug ^/debug/ last; rewrite ^/arrowchat/list ^/list/ last; rewrite ^/arrowchat/mobile ^/mobile/ last; rewrite ^/arrowchat/popout ^/popout/ last; rewrite ^/arrowchat/video ^/video/ last; On trying to reload the nginx conf files by running the command nginx -s reload I am getting an error msg
nginx: [emrg] unknown "rule_0" variable My current default.conf file for nginx looks like this
# # The default server # server { listen 80; server_name jukpac.com; return 301 http://www.jukpac.com$request_uri; } server { listen 80; server_name www.jukpac.com; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.php index.html index.htm; if ($rule_0 = "2"){ rewrite ^/arrowchat/chatroom ^/chatroom/ last; } rewrite ^/arrowchat/cron ^/cron/ last; rewrite ^/arrowchat/debug ^/debug/ last; rewrite ^/arrowchat/list ^/list/ last; rewrite ^/arrowchat/mobile ^/mobile/ last; rewrite ^/arrowchat/popout ^/popout/ last; rewrite ^/arrowchat/video ^/video/ last; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } location ~* \.(?:ico|css|js|gif|jpe?g|png|swf)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # 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$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$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; #} } Can anyone help me out a bit with the rewrite rules?
rootfor the wesbite? and whats/arrowchatis it required in the URL ?/usr/share/nginx/htmland/arrowchatis the folder inside which thearrowchatfiles are located and it is required in the urlwww.jukpac.com/arrowchat/adminbut now when I try it doesn;t work properly the static files don't load, sometimes if i try to open the file 'www.jukpac.com/arrowchat/admin/css/index.html' I get a 404 error even though I can use FTP and see that the index.html file is right there. I am tweaking with the .conf files and sometimes i can make something work but something else crashes. I need the correct and complete rules/arrowchat, and if it is, is it still on apache