0
votes

I am having trouble with the following wildcard subdomain rewrite in a nginx server. Here is the code:

server {

    listen 80;

    server_name *.protegedownloads.com;

    access_log /usr/local/nginx/logs/access_test.log;

    location / {
        root   /var/www/protegedownloads.com;
        rewrite ^(.*)$ ./queryRequest.php?rq=$1&host=$host last;
    }
}

queryRequest.php is just a php page with a phpinfo() in it, but when I access for example http://randomname.protegedownloads.com/ it throws me a 404 error.

Is there a way to test nginx rewrite rules just like I can do with a htaccess file?

Thanks in advance and sorry for my bad English, Vinicius

1

1 Answers

0
votes

You should add into your nginx conf next directives:

http {
    error_log /path/to/log/file.log  notice;
    rewrite_log on;
...