Skip to content

Instantly share code, notes, and snippets.

@jmeyo
Last active January 11, 2017 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmeyo/17db055a26d8490e6e194e2012d4a64c to your computer and use it in GitHub Desktop.
Save jmeyo/17db055a26d8490e6e194e2012d4a64c to your computer and use it in GitHub Desktop.
Mautic nginx conf
server {
listen 80;
server_name mautic.somedomain.com;
root /usr/share/nginx/mautic;
index index.php;
access_log /var/log/nginx/mautic.access.log;
error_log /var/log/nginx/mautic.error.log;
location / {
try_files $uri /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ mtc.js{
try_files $uri /index.php?$query_string;
}
location ~* ^/index.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
# cleanup some requests
if ($http_user_agent ~* (Baiduspider|webalta|nikto|wkito|pikto|scan|acunetix|morfeus|webcollage|youdao) ) {
return 401;
}
if ($http_user_agent ~* (HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) ) {
return 401;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment