Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computer_science:docker:docker_nginx_reverse_proxy [2020/07/30 09:37] – carlossousa | computer_science:docker:docker_nginx_reverse_proxy [2023/12/01 12:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Nginx as Reverse Proxy for Docker Containers ====== | ====== Nginx as Reverse Proxy for Docker Containers ====== | ||
+ | |||
+ | **Important Notice:** | ||
+ | |||
+ | This is an example for a Reverse Proxy. I will be using Traefik to [[: | ||
+ | |||
+ | ---- | ||
My setup for the docker env. is the same as described on [[: | My setup for the docker env. is the same as described on [[: | ||
Line 112: | Line 118: | ||
</ | </ | ||
- | Using your favourite method, deploy your docker-compose.yml setup. I will be using the good old ' | + | Using your favourite method, deploy your **docker-compose.yml |
My configuration would be as follows: | My configuration would be as follows: | ||
Line 154: | Line 160: | ||
- dokuwiki_lib-tpl:/ | - dokuwiki_lib-tpl:/ | ||
- dokuwiki_logs:/ | - dokuwiki_logs:/ | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | And now we edit the **nginx.conf **to point back to our DokuWiki. Note that I will already configure a sub-domain and a main domain, which at the moment would both point to the same container, but once we make [[: | ||
+ | |||
+ | <code bash> | ||
+ | events { | ||
+ | |||
+ | } | ||
+ | |||
+ | http { | ||
+ | #error_log / | ||
+ | client_max_body_size 20m; | ||
+ | |||
+ | proxy_cache_path / | ||
+ | |||
+ | server { | ||
+ | server_name wiki.carlossousa.tech; | ||
+ | |||
+ | location / { | ||
+ | include / | ||
+ | proxy_pass http:// | ||
+ | } | ||
+ | } | ||
+ | |||
+ | server { | ||
+ | server_name carlossousa.tech; | ||
+ | |||
+ | location / { | ||
+ | include / | ||
+ | proxy_pass http:// | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | And finally we will once again create a **backup_to_tar.sh **so we can backup our nginx Reverse Proxy setup: | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | SOURCE_PATH="/ | ||
+ | BACKUP_PATH="/ | ||
+ | BACKUP_NAME=" | ||
+ | tar cvf " | ||