Docker and Ghost CMS overhaul
This commit is contained in:
55
etc/nginx/nginx.conf
Executable file
55
etc/nginx/nginx.conf
Executable file
@@ -0,0 +1,55 @@
|
||||
upstream tomcat {
|
||||
server tomcat:8080;
|
||||
}
|
||||
|
||||
upstream ghost {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
listen [::]:8080 default_server ipv6only=on;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
|
||||
#rewrite ^ https://$http_host$request_uri? permanent; #Redirect traffic to HTTPS
|
||||
|
||||
root /app;
|
||||
index index.html index.htm index.php index.jsp;
|
||||
|
||||
client_max_body_size 100M;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/index.html;
|
||||
}
|
||||
|
||||
####### Proxies #######
|
||||
# PHP proxy
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9001;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
|
||||
# Ghost proxy
|
||||
location /blog {
|
||||
proxy_pass http://ghost;
|
||||
proxy_set_header Host $http_host; # required for docker client's sake
|
||||
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 900;
|
||||
}
|
||||
|
||||
# Tomcat proxy
|
||||
location ~ \.(do|jspa|obr|jsp|txt|zip) {
|
||||
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_pass http://tomcat;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user