나는 내 레일 프로젝트에서의 Nginx의 마지막 안정 버전 (1.10)레일, Nginx에 배포 넣지 않는 응용 프로그램
를 설치 한 나는 nginx.conf
파일을 만든 : 내가 통해 내 레일 응용 프로그램을 배포해야
upstream puma_myapp {
server unix:///var/www/myapp/shared/tmp/sockets/myapp.sock;
}
server {
listen 80 default_server deferred;
# server_name example.com;
root /var/www/myapp/current/public;
access_log /var/www/myapp/current/log/nginx.access.log;
error_log /var/www/myapp/current/log/nginx.error.log info;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma_myapp;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
}
을 카피 스트라 노. 그것은 내 응용을 deamonized.
/etc/nginx
에는 sites-enabled
폴더가 없습니다. 왜 이런 일이, 내 페이지 주소를 열면
sudo service nginx restart
, 나는 아직도의 nginx의 기본 페이지를 얻을 : 다음
sudo ln -nfs "/var/www/myapp/current/config/nginx.conf" "/etc/nginx/sites-enabled/myapp"
내가 내 nginx를 다시 시작 : 그때 내가 이것을 쓴이 폴더를 만들었습니다?
내 puma.rb
파일은 다음과 같습니다
2016/08/16 10:07:01 [error] 10157#10157: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, $
2016/08/16 10:14:49 [error] 10157#10157: *3 open() "/usr/share/nginx/html/phpMyAdmin/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, $
2016/08/16 10:14:55 [error] 10157#10157: *4 open() "/usr/share/nginx/html/pma/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, server:$
2016/08/16 10:15:00 [error] 10157#10157: *5 open() "/usr/share/nginx/html/myadmin/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, ser$
2016/08/16 10:36:20 [error] 26599#26599: *1 open() "/usr/share/nginx/html/admin" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, reques$
2016/08/16 10:42:11 [error] 27962#27962: *1 open() "/usr/share/nginx/html/admin" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, reques$
'puma.rb'도 게시 할 수 있습니까? – slowjack2k
이제'sites-enabled' 폴더가 없다는 작은 힌트를 알게되었습니다. 어떤 운영 체제를 사용합니까? 패키지 관리자를 통해 nginx를 설치 했습니까? 'sites-enabled'가 종료되지 않으면 nginx가'sites-enabled' 내에 configs를 포함하지 않고 nginx.conf 내에'include/etc/nginx/sites-enabled/*;'를 추가해야 함을 의미 할 수 있습니다 – slowjack2k
unicorn puma.rb 파일에서'bind' 대신'listen'을 사용 해보십시오. 퓨마 에러 로그의 결과는 무엇입니까? '/ var/log/nginx/error.log' 또는 위에서 지정한 다른 로그에서 nginx에 오류가 있습니까? – yekta