From 1a48a63ee84d72fb77cceefd9706aaecc2ca573c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Wed, 11 Jan 2023 23:48:12 +0100 Subject: [PATCH] Add example files for nginx --- README.md | 18 +++++++----------- embed.subdomain.conf | 20 ++++++++++++++++++++ i.subdomain.conf | 21 +++++++++++++++++++++ 3 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 embed.subdomain.conf create mode 100644 i.subdomain.conf diff --git a/README.md b/README.md index 5ce79cf..b47f7c9 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,13 @@ embed for you. The embed will be the same as the one you would get if you send a Your webserver infront of discord-embed needs to be configured for this program to work. -Nginx: -```nginx -# One subdomain that is a reverse proxy to discord-embed and one subdomain (SERVE_DOMAIN) for images -# The SERVE_DOMAIN url needs this: -root /var/www/embed; # The UPLOAD_FOLDER where our images are -location / { - try_files $uri $uri/ $uri.html =404; # Note the $uri.html -} -``` +## Nginx -Caddy: -``` +You have two example files here: [embed.subdomain.conf](embed.subdomain.conf) and [i.subdomain.conf](i.subdomain.conf) + +## Caddy + +```yaml # SERVE_DOMAIN = i.example.com # UPLOAD_FOLDER = /var/www/embed embed.example.com { @@ -46,6 +41,7 @@ i.example.com { file_server } ``` + ## Need help? - Email: [tlovinator@gmail.com](mailto:tlovinator@gmail.com) diff --git a/embed.subdomain.conf b/embed.subdomain.conf new file mode 100644 index 0000000..5d67e56 --- /dev/null +++ b/embed.subdomain.conf @@ -0,0 +1,20 @@ +server { + listen 443 ssl; + listen [::]:443 ssl; + + # This is where you send the POST request to + server_name embed.example.com; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + location / { + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app discord-embed; # This is the name of the container where discord-embed is running + set $upstream_port 5000; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + } +} \ No newline at end of file diff --git a/i.subdomain.conf b/i.subdomain.conf new file mode 100644 index 0000000..1bbb73e --- /dev/null +++ b/i.subdomain.conf @@ -0,0 +1,21 @@ +server { + listen 443 ssl; + listen [::]:443 ssl; + + # Where images are served from + # Should be your SERVE_DOMAIN + # Example: https://i.example.com/firefox_5dze5fqAEp.png + server_name i.example.com; + + # Where the images are stored + # This is your UPLOAD_FOLDER + root /var/www/embed; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + location / { + try_files $uri $uri/ $uri.html =404; # Note the $uri.html + } +}