Last active
April 23, 2022 16:01
Star
You must be signed in to star a gist
Using Mecha under Nginx instead of Apache web server.
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 443 ssl; | |
root /path/to/www; | |
index index.php index.html; | |
server_name mecha-cms.com; | |
# access_log /path/to/www/access-logs/access.log; | |
# error_log /path/to/www/access-logs/error.log; | |
# include /etc/letsencrypt/options-ssl-nginx.conf; | |
charset utf-8; | |
location = /ads.txt { | |
allow all; | |
} | |
location = /favicon.ico { | |
allow all; | |
} | |
# Google’s site verification file must be accessible in public! | |
# Replace `XXXXXXXXXXXXXXXXX` with your original file suffix | |
location = /googleXXXXXXXXXXXXXXXXX.html { | |
allow all; | |
} | |
location = /robots.txt { | |
allow all; | |
} | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ^~ /engine/ { | |
deny all; | |
return 403; | |
} | |
location ^~ /lot/ { | |
deny all; | |
return 403; | |
} | |
location ^~ /lot/asset/ { | |
allow all; | |
} | |
location ^~ /lot/[xy]/[^/]+/.*?\.(css|gif|jpe?g|js|a?png|svg)$ { | |
allow all; | |
} | |
location ~ /\. { | |
deny all; | |
return 403; | |
} | |
location ~ \.php$ { | |
include fastcgi_params; | |
include snippets/fastcgi-php.conf; | |
fastcgi_intercept_errors on; | |
fastcgi_pass unix:/run/php/php7.2-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment