markdown Rails + React build + Active Storage资产
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Rails + React build + Active Storage资产相关的知识,希望对你有一定的参考价值。
- Install passenger
- Install nginx
- Install nginx-passenger
- Configure nginx-passenger for ruby path
## Nginx conf
`/etc/nginx/site-available/domain.com`
```text
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
root /home/deploy/www/sublime/current/public;
# Add index.php to the list if you are using PHP
index index.html;
server_name 51.91.25.18;
access_log /home/deploy/www/sublime/logs/access.log;
error_log /home/deploy/www/sublime/logs/errors.log;
server_name localhost;
passenger_enabled on;
passenger_app_env production;
location ~* ^.+\.(jpeg|gif|png|jpg|webp) {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
}
location /sidekiq {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
}
location /api {
# Insert your public app path
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri /index.html;
}
}
```
以上是关于markdown Rails + React build + Active Storage资产的主要内容,如果未能解决你的问题,请参考以下文章
markdown 升级Rails
markdown Rails新
markdown Ruby on Rails Cheatsheet
markdown Rails缓存
markdown 如何部署Rails应用程序
markdown Rails和Backbone.js设置