Add example files for nginx
This commit is contained in:
18
README.md
18
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.
|
Your webserver infront of discord-embed needs to be configured for this program to work.
|
||||||
|
|
||||||
Nginx:
|
## 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
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
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
|
# SERVE_DOMAIN = i.example.com
|
||||||
# UPLOAD_FOLDER = /var/www/embed
|
# UPLOAD_FOLDER = /var/www/embed
|
||||||
embed.example.com {
|
embed.example.com {
|
||||||
@ -46,6 +41,7 @@ i.example.com {
|
|||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Need help?
|
## Need help?
|
||||||
|
|
||||||
- Email: [tlovinator@gmail.com](mailto:tlovinator@gmail.com)
|
- Email: [tlovinator@gmail.com](mailto:tlovinator@gmail.com)
|
||||||
|
20
embed.subdomain.conf
Normal file
20
embed.subdomain.conf
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
21
i.subdomain.conf
Normal file
21
i.subdomain.conf
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user