Guest User

Untitled

a guest
Jun 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. > user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log;
  4. pid /var/run/nginx.pid;
  5.  
  6. # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
  7. include /usr/share/nginx/modules/*.conf;
  8.  
  9. events {
  10. worker_connections 1024;
  11. }
  12.  
  13. http {
  14. log_format main '$remote_addr - $remote_user [$time_local]
  15. "$request" '
  16. '$status $body_bytes_sent "$http_referer" '
  17. '"$http_user_agent" "$http_x_forwarded_for"';
  18.  
  19. access_log /var/log/nginx/access.log main;
  20.  
  21. sendfile on;
  22. tcp_nopush on;
  23. tcp_nodelay on;
  24. keepalive_timeout 65;
  25. types_hash_max_size 2048;
  26.  
  27. include /etc/nginx/mime.types;
  28. default_type application/octet-stream;
  29.  
  30. # Load modular configuration files from the /etc/nginx/conf.d directory.
  31. # See http://nginx.org/en/docs/ngx_core_module.html#include
  32. # for more information.
  33. include /etc/nginx/conf.d/*.conf;
  34.  
  35. index index.html index.htm;
  36.  
  37. server {
  38. listen 80 ;
  39. listen [::]:80 ;
  40. server_name localhost;
  41. root /usr/share/nginx/html;
  42.  
  43. # Load configuration files for the default server block.
  44. include /etc/nginx/default.d/*.conf;
  45.  
  46. location / {
  47. }
  48.  
  49. # redirect server error pages to the static page /40x.html
  50. #
  51. error_page 404 /404.html;
  52. location = /40x.html {
  53. }
  54.  
  55. # redirect server error pages to the static page /50x.html
  56. #
  57. error_page 500 502 503 504 /50x.html;
  58. location = /50x.html {
  59. }
  60.  
  61. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  62. #
  63. #location ~ .php$ {
  64. # proxy_pass http://127.0.0.1;
  65. #}
  66.  
  67. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  68. #
  69. #location ~ .php$ {
  70. # root html;
  71. # fastcgi_pass 127.0.0.1:9000;
  72. # fastcgi_index index.php;
  73. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  74. # include fastcgi_params;
  75. #}
  76.  
  77. # deny access to .htaccess files, if Apache's document root
  78. # concurs with nginx's one
  79. #
  80. #location ~ /.ht {
  81. # deny all;
  82. #}
  83. }
  84.  
  85. log_format healthd '$msec"$uri"'
  86. '$status"$request_time"$upstream_response_time"'
  87. '$http_x_forwarded_for';
  88.  
  89. server {
  90. listen 80;
  91. server_name _ localhost; # need to listen to localhost for worker tier
  92.  
  93. if ($time_iso8601 ~ "^(d{4})-(d{2})-(d{2})T(d{2})") {
  94. set $year $1;
  95. set $month $2;
  96. set $day $3;
  97. set $hour $4;
  98. }
  99.  
  100. access_log /var/log/nginx/access.log main;
  101. access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
  102.  
  103. location / {
  104. proxy_pass http://my_app; # match the name of upstream directive which is defined above
  105. proxy_set_header Host $host;
  106. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  107. }
  108.  
  109. location /assets {
  110. alias /var/app/current/public/assets;
  111. gzip_static on;
  112. gzip on;
  113. expires max;
  114. add_header Cache-Control public;
  115. }
  116.  
  117. location /public {
  118. alias /var/app/current/public;
  119. gzip_static on;
  120. gzip on;
  121. expires max;
  122. add_header Cache-Control public;
  123. }
  124. }
  125.  
  126. user root;
  127.  
  128. error_log /var/log/app-nginx-error.log;
  129. pid /var/run/app-nginx.pid;
  130.  
  131. events {
  132. worker_connections 8096;
  133. multi_accept on;
  134. use epoll;
  135. }
  136.  
  137. http {
  138. ....
  139.  
  140. include /etc/nginx/mime.types;
  141. default_type application/octet-stream;
  142.  
  143. upstream appserver {
  144. server unix:///var/run/puma.sock;
  145. }
  146.  
  147. ....
  148. }
  149.  
  150. upstream appserver {
  151. server unix:///var/run/puma.sock;
  152. }
Add Comment
Please, Sign In to add comment