Answer the question
In order to leave comments, you need to log in
How to configure a host to open at 127.0.0.1?
Good afternoon, the
host of norms opens only by its name, but I need it to open also by
127.0.
server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name xxx;
root '/home/mmm/xxx/frontend/web/';
index index.php;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
#error_page 404 /404.html;
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~* /\. {
deny all;
}
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
server_namelocalhost;
location / {
try_files $uri $uri/ =404;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question