Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #user nobody;
- worker_processes 2;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- #passenger_root /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.23;
- #passenger_ruby /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers/ruby;
- include mime.types;
- default_type application/octet-stream;
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- # '$status $body_bytes_sent "$http_referer" '
- # '"$http_user_agent" "$http_x_forwarded_for"';
- #access_log logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- gzip on;
- upstream unicorn {
- server unix:/tmp/unicorn.mydomain.sock fail_timeout=0;
- }
- server {
- listen 80;
- server_name www.mydomain.ru;
- rewrite ^(www.)?(.*)$ $scheme://$2$request_uri last;
- return 301 http://mydomain.ru$request_uri;
- }
- server {
- listen 80;
- server_name mydomain.ru;
- #if ($host ~* ^(www.)?(.*)$) {
- if ($host ~* ^www.(.*)$) {
- #server_name mydomain.ru;
- return 301 $scheme://$1$request_uri;
- }
- root /home/ubuntu/123/current/public;
- #passenger_enabled on;
- client_max_body_size 30M;
- #charset koi8-r;
- #access_log logs/host.access.log main;
- location ^~ /assets/ {
- gzip_static on;
- expires max;
- add_header Cache-Control public;
- }
- try_files $uri/index.html $uri @unicorn;
- location @unicorn {
- proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header CLIENT_IP $remote_addr;
- proxy_redirect off;
- proxy_pass http://unicorn;
- }
- }
- }
Add Comment
Please, Sign In to add comment