Skip to content

Instantly share code, notes, and snippets.

@sofasurfer
Created February 11, 2012 22:25
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 sofasurfer/1804706 to your computer and use it in GitHub Desktop.
Save sofasurfer/1804706 to your computer and use it in GitHub Desktop.
NGINX MODX Host File
# MODX Redmine Virtual Host Config
# @sofasurfer.org
server {
listen 80;
server_name *.mymodx.com *.amazonaws.com;
root /var/www/mymodx;
index index.php;
client_max_body_size 30M;
access_log /var/log/nginx/access-mymodx.log main;
# redirect to www
if ($host = 'mymodx.com' ) {
rewrite ^/(.*)$ http://www.mymodx.org/$1 permanent;
}
location / {
# redirect MODX URL rewrite
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort on;
fastcgi_param SERVER_NAME $http_host;
#fastcgi_param HTTPS on;
#fastcgi_param HTTPS $php_https;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment