It took two weeks for Google to deploy the method, many of the methods are not used, and eventually I used the control variable method, a modified configuration file modification succeeded.
First,/etc/nginx/vhosts/limlog.sloger.info.conf and CONFIG/PUMA.RB.
# #
/etc/nginx/vhosts/limlog.sloger.info.conf
#
upstream Limlog {
server unix:///tmp/ Limlog.sock;
}
server {
listen;
server_name limlog.sloger.info;
Root /srv/http/limlog.sloger.info/public;
Access_log /var/log/nginx/limlog-access.log;
Error_log /var/log/nginx/limlog-error.log info;
Location/{
expires max;
Add_header Cache-control public;
Proxy_redirect off ;
Proxy_set_header Host $http _host;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass http://limlog;
}
Location ~ ^/assets/{
expires 1y;
Gzip_static on;
Add_header ETag "";
Add_header Cache-control public;
break;
}
}
#!/usr/bin/env ruby-w
#
config/puma.rb #
rails_env = env[' rails_env '] | | ' Development '
threads 4, 4
bind ' Unix:///tmp/limlog.sock '
pidfile '/tmp/limlog.pid ' State_path '
Tmp/limlog.state '
Activate_control_app
Change the root server_name upstream in the Nginx configuration file to your line, where each file is placed, and the file head annotation is written.
Then modify the CONFIG/ENVIRONMENS/PRODUCTION.RB
18 Line false to True
# Disable Rails ' s static asset server (Apache or nginx'll already do this).
Config.serve_static_assets = True
29 Line Uncomment
# Specifies the header that your server uses for sending files.
# Config.action_dispatch.x_sendfile_header = "X-sendfile" # for Apache
Config.action_dispatch.x_sendfile_header = ' X-accel-redirect ' # for Nginx
And then the App/controller/application_controller.
The second line of arguments with:: Exception remove
And then the hand is secret_key_base
My practice is to create a file env.sh
# Use Rake secret to generate key, then paste in = behind
export secret_key_base=
# can export various environment variables
Start
Start or restart Nginx
Import environment variable Source env.sh
Start Rails bundle Exec-c CONFIG/PUMA.RB-E Production
Now the deployment is complete, the most vexing assets also solved ~