nginx thin 배치 rails 3 프로그램

1504 단어
  • thin 설치
    gem install thin
    실행:
    thin start 
    실행 여 부 를 테스트 합 니 다
  • 프로필 생 성
    thin config -C myapp.yml -s3 -p 3000
    thin start -C myapp.yml
  • nginx. conf 파일 설정
       upstream mongrel {
         server 127.0.0.1:3001;
         server 127.0.0.1:3002;
         server 127.0.0.1:3003;
       }
    
     server {
        listen 3000;
    
        client_max_body_size 100M;
        root /var/www/sms/public;
        access_log  /var/www/sms/log/nginx.access.log;
    
        if (-f $document_root/system/maintenance.html) {
          rewrite  ^(.*)$  /system/maintenance.html last;
          break;
        }
    
        location / {
          proxy_set_header  X-Real-IP  $remote_addr;
    
          # needed for HTTPS
          proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_redirect false;
          proxy_max_temp_file_size 0;
    
          if (-f $request_filename) {
            break;
          }
    
          if (-f $request_filename/index.html) {
            rewrite (.*) $1/index.html break;
          }
    
        if (-f $request_filename.html) {
            rewrite (.*) $1.html break;
          }
    
          if (!-f $request_filename) {
            proxy_pass http://mongrel;
            break;
          }
        }
    
        error_page   500 502 503 504  /500.html;
        location = /500.html {
          root   /var/www/sms/public;
        }
      }
    
    
  • thin 클 러 스 터 시작
    thin start -C myapp.yml
  • 좋은 웹페이지 즐겨찾기