-
-
Save agmukhin/ff1200f66fc900cc4d849ce98cf44a07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jion_nginx.conf | |
# jion_nginx.conf | |
upstream django { | |
server unix:/jion_capital/jion.sock; # взаимодействие с uwsgi через Unix-сокет (мы воспользуемся этим вариантом позже) | |
#server 127.0.0.1:8000; # взаимодействие с uwsgi через веб-порт | |
} | |
# конфигурация веб-сервера | |
server { | |
# порт, который будет слушать веб-сервер в ожидании запросов от пользователй | |
listen 8000; | |
# доменное имя | |
server_name .jion.capital; # замените на собственный домен или IP адрес | |
charset utf-8; | |
# максимальный размер загружаемых на сервер данных | |
client_max_body_size 75M; | |
# обслуживание медиа файлов и статики | |
location /media/ { | |
alias /jion_capital/media/; # расположение медиафайлов (при необходимости измените) | |
} | |
location /static/ { | |
alias /jion_capital/static/; # расположение статики (при необходимости измените) | |
autoindex off; | |
} | |
# Остальные запросы перенаправляются в Django приложение | |
location / { | |
uwsgi_pass django; | |
include /jion_capital/uwsgi_params; # файл uwsgi_params, который мы только что взяли с github | |
} | |
} | |
$ sudo nginx -t | |
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok | |
nginx: configuration file /etc/nginx/nginx.conf test is successful |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment