Created
October 8, 2021 11:28
-
-
Save ilyautkin/247d79e87e10e96958bd2fb868211989 to your computer and use it in GitHub Desktop.
Конфиг сервера NGinx
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 localhost; | |
root /var/doodle/www; | |
error_log /var/log/nginx/error.log; | |
access_log /var/log/nginx/access.log; | |
index index.php index.html index.htm; | |
charset utf-8; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Real-Host $host; | |
try_files $uri $uri/ @handler; | |
if (!-e $request_filename) { | |
rewrite ^/(.*)$ /index.php?q=$1 last; | |
} | |
} | |
location @handler { | |
rewrite / /index.php; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
location ~ \.php$ { | |
if (!-e $request_filename) { | |
rewrite / /index.php last; | |
} | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_script_name; | |
fastcgi_pass php:9000; | |
fastcgi_hide_header X-Powered-By; | |
fastcgi_read_timeout 180; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment