Last active
October 10, 2019 03:03
-
-
Save huiyonghkw/9a566c8023f4f9e9e1272970c7a10791 to your computer and use it in GitHub Desktop.
Nginx Default Conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
root /var/www/localhost; | |
index index.html index.htm index.php; | |
access_log /var/log/nginx/log/localhost.access.log main; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
error_page 404 /404.html; | |
# 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; | |
} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ | |
{ | |
expires 1d; | |
} | |
location ~ .*\.(js|css)?$ | |
{ | |
expires 2h; | |
} | |
location ~ /.well-known { | |
allow all; | |
} | |
location ~ /\. | |
{ | |
deny all; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
location ~ /\.ht { | |
deny all; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
local.lingyang.tech.conf
ssl.local.lingyang.tech.conf