mirror of https://gitlab.crans.org/bde/nk20
Simplify NGINX examples
This commit is contained in:
parent
48d3e8960a
commit
9a52c81bff
|
@ -1,23 +1,27 @@
|
||||||
upstream note {
|
# This is an example NGINX site configuration for note_kfet in Docker
|
||||||
server 127.0.0.1:8000;
|
# Only HTTP, please use a reverse proxy to secure it!
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
# Serve this site by default on HTTP
|
||||||
server_name note;
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
# Max upload size
|
||||||
|
client_max_body_size 75M;
|
||||||
|
|
||||||
|
# Django statics and media
|
||||||
|
location /static {
|
||||||
|
alias /code/static;
|
||||||
|
}
|
||||||
|
location /media {
|
||||||
|
alias /code/media;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Send all non-media requests to the Django server.
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://note;
|
proxy_pass http://127.0.0.1:8000;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /static {
|
|
||||||
alias /code/static/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /media {
|
|
||||||
alias /code/media/;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,25 @@
|
||||||
# nginx_songbook.conf
|
# This is an example NGINX site configuration for note_kfet behind a reverse proxy
|
||||||
# the upstream component nginx needs to connect to
|
# Only HTTP, please use a reverse proxy to secure it!
|
||||||
upstream note{
|
|
||||||
server unix:///var/www/note_kfet/note_kfet.sock; # file socket
|
|
||||||
}
|
|
||||||
|
|
||||||
# configuration of the server
|
|
||||||
server {
|
server {
|
||||||
# the port your site will be served on
|
# Serve this site by default on HTTP
|
||||||
listen 80;
|
listen 80 default_server;
|
||||||
# the domain name it will serve for
|
listen [::]:80 default_server;
|
||||||
server_name note.example.org; # substitute your machine's IP address or FQDN
|
|
||||||
charset utf-8;
|
|
||||||
|
|
||||||
# max upload size
|
# Max upload size
|
||||||
client_max_body_size 75M; # adjust to taste
|
client_max_body_size 75M;
|
||||||
|
|
||||||
# Django media
|
|
||||||
location /media {
|
|
||||||
alias /var/www/note_kfet/media; # your Django project's media files - amend as required
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# Django statics and media
|
||||||
location /static {
|
location /static {
|
||||||
alias /var/www/note_kfet/static; # your Django project's static files - amend as required
|
alias /var/www/note_kfet/static;
|
||||||
|
}
|
||||||
|
location /media {
|
||||||
|
alias /var/www/note_kfet/media;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Finally, send all non-media requests to the Django server.
|
# Send all non-media requests to the Django server.
|
||||||
location / {
|
location / {
|
||||||
uwsgi_pass note;
|
uwsgi_pass unix:///var/www/note_kfet/note_kfet.sock;
|
||||||
include /var/www/note_kfet/uwsgi_params; # the uwsgi_params file you installed
|
include /etc/nginx/uwsgi_params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue