Configuring Nginx with Jira & Sendy

As a follow up to my previous post, the next two applications that needed migration were our Jira and Sendy installations.

Here are the Nginx configs for both:

server {
listen 80;
server_name jira.example.com;
access_log /var/log/nginx/jira.example.com.access.log main;
error_log /var/log/nginx/jira.example.com.error.log;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
port_in_redirect off;
proxy_redirect http://jira.example.com:8080/jira /;
proxy_connect_timeout 300;
}
# deny access to .htaccess files
location ~ /\.ht {
deny all;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

view raw
jira.nginx.conf
hosted with ❤ by GitHub

upstream php-sendy-example-com {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name sendy.example.com;
root /home/webapps/sendy.example.com/;
access_log /var/log/nginx/sendy.example.com.access.log main;
error_log /var/log/nginx/sendy.example.com.error.log;
location / {
index index.html index.htm index.php;
try_files $uri $uri/ $uri.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-sendy-example-com;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /l/ {
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
}
location /t/ {
rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
}
location /w/ {
rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
}
location /unsubscribe/ {
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
}
location /subscribe/ {
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
}
# deny access to .htaccess files
location ~ /\.ht {
deny all;
}
}

view raw
sendy.nginx.conf
hosted with ❤ by GitHub

One thought on “Configuring Nginx with Jira & Sendy”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s