Skip to content

Instantly share code, notes, and snippets.

@rherrick
Last active August 29, 2015 14:14
Show Gist options
  • Save rherrick/3775ccc5dd93c7ca457f to your computer and use it in GitHub Desktop.
Save rherrick/3775ccc5dd93c7ca457f to your computer and use it in GitHub Desktop.
nginx conf for ldap php app and xnatdev Tomcat app
server {
listen ldap.wurstworks.com:80;
server_name ldap.wurstworks.com;
root /tmp/test
index index.php index.html index.htm;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files
location ~ /\.ht {
deny all;
}
# log_format compression '$remote_addr - $remote_user [$time_local] '
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent"';
access_log /tmp/test/access.log
error_log /tmp/test/error.log warn;
}
server {
listen xnatdev.wurstworks.com:80;
server_name xnatdev.wurstworks.com;
location / {
root /var/lib/tomcat7/webapps/xnat;
proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080 $scheme://xnatdev;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 0;
client_body_buffer_size 128k;
}
}
server {
listen xnatdev.wurstworks.com:80;
server_name xnatdev.wurstworks.com;
location / {
root /var/lib/tomcat7/webapps/xnat;
proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080 $scheme://xnatdev;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 0;
client_body_buffer_size 128k;
}
location /ldap/ {
root /usr/share/phpldapadmin/htdocs;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location /test/ {
root /tmp/test;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment