Monday, July 16, 2018

rewrite rule setting in nginx

I install nginx 1.0.0 and i installed it /usr/local/nginx1.0.0/.
and I try to modify /usr/local/nginx1.0.0/cont/nginx.conf file.



I just copy default file. and replace server_name and root path



and I connected example.com -> it works (there is nginx working message.)



but I connected www.example.com -> it is not working.(there is 404 Not Found message.)



and url is =

http://www.example.com/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/



and I try to server_name => example.com *.example.com (but same problum)



this is my nginx.conf code.
am i wrong config? or wrong install?



server {
listen 80;
server_name .example.com;


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

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}


location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME html$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {

deny all;
}
}

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...