Add nginx config to serve static files. (#422)

* Add config to serve static files.

* Remove non useful comments

* More minor change
This commit is contained in:
Abhilash Raj
2021-01-17 10:09:51 -08:00
committed by GitHub
parent fa9cb4fd54
commit 061623336f

View File

@@ -211,6 +211,7 @@ password, plese follow the "Forgot Password" link on the "Sign In" page.
To configure the mailman-web container to send emails, add this to your
`settings_local.py`.:
```
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = '172.19.199.1'
@@ -284,9 +285,6 @@ server configuration.
See [the nginx configuration][17] as an example.
This command will do several things, most importantly:
- Run a wsgi server using [`uwsgi`][7] for the Mailman's Django-based web
@@ -479,17 +477,20 @@ header when you proxy the requests from your Web Server. In Nginx you can do
that by adding the following to your configuration:
```
# Nginx configuration.
# Nginx configuration.
location /static {
alias /opt/mailman/web/static;
autoindex off;
}
location / {
# First attempt to serve request as file, then
location / {
proxy_pass http://172.19.199.3:8000;
include uwsgi_params;
uwsgi_read_timeout 300;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
```
@@ -511,15 +512,17 @@ are generally included in the distro packages.
To move to uwsgi protocol in the above nginx configuration use this
```
# Nginx configuration.
location / {
# First attempt to serve request as file, then
# Nginx configuration.
location /static {
alias /opt/mailman/web/static;
autoindex off;
}
location / {
uwsgi_pass 172.19.199.3:8080;
include uwsgi_params;
uwsgi_read_timeout 300;
}
}
```
Please make sure that you are using v0.1.1 or greater if you use this configuration.
@@ -567,7 +570,7 @@ fi
exit 0
```
Please do not forget to make the script executable (chmod +x certbot-renew.sh).
**Please do not forget to make the script executable (`chmod +x certbot-renew.sh`).**
LICENSE
=======