Created
August 12, 2019 20:09
-
-
Save artemrogov/d665627e87a83e571b9ffa0ef33cf472 to your computer and use it in GitHub Desktop.
simple html web-app nginx configuration
This file contains hidden or 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 <site_name.com>; | |
index index.html; | |
client_max_body_size 50M; | |
gzip on; # включаем сжатие gzip | |
gzip_disable "msie6"; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; | |
root /home/artemdev/portfolio; | |
location ~ /\. { | |
deny all; # запрет для скрытых файлов | |
} | |
location ~* /(?:uploads|files)/.*\.php$ { | |
deny all; # запрет для загруженных скриптов | |
} | |
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { | |
access_log off; | |
log_not_found off; | |
expires max; # кеширование статики | |
} | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment