blacklabelops-legacy / nginx

Dockerized Ready-To-Go Nginx Reverse Proxy. Let's encrypt Support!
MIT License
95 stars 41 forks source link

When using a context path for the jira installation there seems to be an issue with Nginx redirecting correctly #16

Closed girlandhercode closed 7 years ago

girlandhercode commented 7 years ago

nginx docker run command used:

sudo docker run -d -p 443:443 -p 80:80 --network ssljiranet \
  -v letsencrypt_certs:/etc/letsencrypt -e "SERVER1LETSENCRYPT_CERTIFICATES=true" -e  \ 
 "SERVER1CERTIFICATE_FILE=/etc/letsencrypt/live/example.edu/cert.pem" -e  \ 
 "SERVER1CERTIFICATE_KEY=/etc/letsencrypt/live/example.edu/privkey.pem" -e \ 
 "SERVER1CERTIFICATE_TRUSTED=/etc/letsencrypt/live/example.edu/chain.pem" -e \ 
 "SERVER1REVERSE_PROXY_LOCATION1=/" -e "SERVER1PROXY_APPLICATION=jira" -e \ 
 "SERVER1SERVER_NAME=example.edu" -e "SERVER1REVERSE_PROXY_PASS1=http://ssljira:8080" -e \ 
 "SERVER1HTTPS_ENABLED=true" -e "SERVER1HTTP_ENABLED=false" --name sslnginx \ blacklabelops/nginx

jira docker run command used:

sudo docker run -d --name ssljira --network ssljiranet --link ssljiramysql:mysql -e \
 "JIRA_DATABASE_URL=mysql://172.19.0.2:3306/jiradb" -e "JIRA_DB_PASSWORD=password" -e \ 
 "JIRA_PROXY_NAME=example.edu" -e "JIRA_PROXY_PORT=443" -e "JIRA_PROXY_SCHEME=https" \ -p 9090:8080 blacklabelops/jira

These result in the jira 404 page:

2017-04-12 16_55_44_jira

http does forward to https successfully.

without nginx, the http://example.edu:9090/jira shows the jira setup screen.

girlandhercode commented 7 years ago

Thank you @blacklabelops for all of your time and advice. This is now working with the following commands:

nginx container command:

sudo docker run -d -p 443:443 -p 80:80 --network ssljiranet \
  -v letsencrypt_certs:/etc/letsencrypt -e "SERVER1LETSENCRYPT_CERTIFICATES=true" -e  \ 
 "SERVER1CERTIFICATE_FILE=/etc/letsencrypt/live/example.edu/cert.pem" -e  \ 
 "SERVER1CERTIFICATE_KEY=/etc/letsencrypt/live/example.edu/privkey.pem" -e \ 
 "SERVER1CERTIFICATE_TRUSTED=/etc/letsencrypt/live/example.edu/chain.pem" -e \ 
 "SERVER1REVERSE_PROXY_LOCATION1=/jira" -e "SERVER1PROXY_APPLICATION=jira" -e \ 
 "SERVER1SERVER_NAME=example.edu" -e "SERVER1REVERSE_PROXY_PASS1=http://ssljira:8080" -e \
 "SERVER1HTTPS_ENABLED=true" -e "NGINX_REDIRECT_PORT80=true" -e \
 "SERVER1HTTP_ENABLED=false" --name sslnginx \ 
 blacklabelops/nginx

jira container command:

sudo docker run -d --name ssljira --network ssljiranet --link ssljiramysql:mysql -e \
 "JIRA_DATABASE_URL=mysql://172.19.0.2:3306/jiradb" -e "JIRA_DB_PASSWORD=password" -e \ 
 "JIRA_PROXY_NAME=example.edu" -e "JIRA_PROXY_PORT=443" -e \
 "JIRA_PROXY_SCHEME=https" -e "JIRA_CONTEXT_PATH=jira" \
 -p 9090:8080 blacklabelops/jira

Thank you!!!