Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 Re: Troubleshooting » Nginx rewrite rule » 2012-03-22 08:10:58

There is simple solution for nginx:

server {
    server_name pornfan.tv www.pornfan.tv;
    access_log /usr/share/nginx/html/pornfan/log/pornfan_access.log;
    error_log /usr/share/nginx/html/pornfan/log/pornfan_error.log;
    root /usr/share/nginx/html/pornfan/public;

    if ($host ~* ^[^.]+\.[^.]+$) {
        rewrite ^(.*)$ http://www.$host$1 permanent;
    }

    location / {
        index index.html index.htm index.php;
    }

    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php?q=$1 last;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        add_header X-PHP-Script $fastcgi_script_name;
        add_header X-PHP-Args $args;
    }

}

Board footer

Powered by FluxBB