Last active
November 19, 2018 07:36
-
-
Save artemrogov/1c79b2c60ef0c3170360a478cb86f887 to your computer and use it in GitHub Desktop.
Настройка nginx и подключение SSL сертификата, плюс выставлены настройки для deployer.php
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 domain_name.com www.domain_name.com; | |
return 301 https://domain_name.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_certificate /etc/nginx/ssl/domain_name.com.cert; | |
ssl_certificate_key /etc/nginx/ssl/domain_name.key; | |
error_log /home/qian/logs_server/error.log; | |
access_log /home/qian/logs_server/access.log; | |
root /home/qian/app/current/public; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options "nosniff"; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
error_page 404 /index.php; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
fastcgi_param DOCUMENT_ROOT $realpath_root; | |
include fastcgi_params; | |
} | |
location ~ /\.(?!well-known).* { | |
deny all; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment