Last active
May 7, 2020 09:54
-
-
Save shilovk/1752160822dc9497576b3fc4c3da2753 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# sudo vi /etc/nginx/sites-enabled/passenger.qna.conf | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name qna.shilovk.ru; | |
rails_env production; | |
root /home/deployer/qna/current/public; | |
client_max_body_size 20M; # для загрузки макисмального размера файла если файлы хранятся локально, а не в облаке | |
passenger_enabled on; | |
location /cable { | |
passenger_app_group_name your_app_websocket; | |
passenger_force_max_concurrent_requests_per_process 0; | |
} | |
location ^~ /assets/ { | |
gzip_static on; # включаем сжатие ассетов гзипом, но не забываем глобально включить gzip on; | |
expires max; # включаем максимальное время кеширования | |
add_header Cache-Control public; # добавляем хедер как кешировать файлы | |
} | |
location ~ \.php { | |
return 404; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment