Last active
January 15, 2025 03:52
-
-
Save taufik-nurrohman/1da313a2db48a26d836d781258b6c139 to your computer and use it in GitHub Desktop.
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 your-site-domain.tld; | |
# 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$ { | |
fastcgi_intercept_errors on; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass unix:/run/php-fpm/www.sock; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment