Advertisement
Guest User

nginx-t

a guest
May 29th, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.12 KB | None | 0 0
  1. nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
  2. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  3. nginx: configuration file /etc/nginx/nginx.conf test is successful
  4. # configuration file /etc/nginx/nginx.conf:
  5. # For more information on configuration, see:
  6. # * Official English Documentation: http://nginx.org/en/docs/
  7. # * Official Russian Documentation: http://nginx.org/ru/docs/
  8.  
  9. user nginx;
  10. worker_processes auto;
  11. error_log /var/log/nginx/error.log;
  12. pid /var/run/nginx.pid;
  13.  
  14. # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
  15. include /usr/share/nginx/modules/*.conf;
  16.  
  17. events {
  18. worker_connections 1024;
  19. }
  20.  
  21. http {
  22. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  23. '$status $body_bytes_sent "$http_referer" '
  24. '"$http_user_agent" "$http_x_forwarded_for"';
  25.  
  26. access_log /var/log/nginx/access.log main;
  27.  
  28. sendfile on;
  29. tcp_nopush on;
  30. tcp_nodelay on;
  31. keepalive_timeout 65;
  32. types_hash_max_size 2048;
  33.  
  34. include /etc/nginx/mime.types;
  35. default_type application/octet-stream;
  36.  
  37. # Load modular configuration files from the /etc/nginx/conf.d directory.
  38. # See http://nginx.org/en/docs/ngx_core_module.html#include
  39. # for more information.
  40. include /etc/nginx/conf.d/*.conf;
  41.  
  42. index index.html index.htm;
  43.  
  44. server {
  45. listen 80 ;
  46. listen [::]:80 ;
  47. server_name localhost;
  48. root /usr/share/nginx/html;
  49.  
  50. # Load configuration files for the default server block.
  51. include /etc/nginx/default.d/*.conf;
  52.  
  53. location / {
  54. }
  55.  
  56. # redirect server error pages to the static page /40x.html
  57. #
  58. error_page 404 /404.html;
  59. location = /40x.html {
  60. }
  61.  
  62. # redirect server error pages to the static page /50x.html
  63. #
  64. error_page 500 502 503 504 /50x.html;
  65. location = /50x.html {
  66. }
  67.  
  68. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  69. #
  70. #location ~ \.php$ {
  71. # proxy_pass http://127.0.0.1;
  72. #}
  73.  
  74. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  75. #
  76. #location ~ \.php$ {
  77. # root html;
  78. # fastcgi_pass 127.0.0.1:9000;
  79. # fastcgi_index index.php;
  80. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  81. # include fastcgi_params;
  82. #}
  83.  
  84. # deny access to .htaccess files, if Apache's document root
  85. # concurs with nginx's one
  86. #
  87. #location ~ /\.ht {
  88. # deny all;
  89. #}
  90. }
  91.  
  92. # Settings for a TLS enabled server.
  93. #
  94. # server {
  95. # listen 443 ssl http2 ;
  96. # listen [::]:443 ssl http2 ;
  97. # server_name _;
  98. # root /usr/share/nginx/html;
  99. #
  100. # ssl_certificate "/etc/pki/nginx/server.crt";
  101. # ssl_certificate_key "/etc/pki/nginx/private/server.key";
  102. # # It is *strongly* recommended to generate unique DH parameters
  103. # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
  104. # #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
  105. # ssl_session_cache shared:SSL:1m;
  106. # ssl_session_timeout 10m;
  107. # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  108. # ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
  109. # ssl_prefer_server_ciphers on;
  110. #
  111. # # Load configuration files for the default server block.
  112. # include /etc/nginx/default.d/*.conf;
  113. #
  114. # location / {
  115. # }
  116. #
  117. # error_page 404 /404.html;
  118. # location = /40x.html {
  119. # }
  120. #
  121. # error_page 500 502 503 504 /50x.html;
  122. # location = /50x.html {
  123. # }
  124. # }
  125.  
  126. }
  127.  
  128.  
  129. # configuration file /etc/nginx/mime.types:
  130.  
  131. types {
  132. text/html html htm shtml;
  133. text/css css;
  134. text/xml xml;
  135. image/gif gif;
  136. image/jpeg jpeg jpg;
  137. application/javascript js;
  138. application/atom+xml atom;
  139. application/rss+xml rss;
  140.  
  141. text/mathml mml;
  142. text/plain txt;
  143. text/vnd.sun.j2me.app-descriptor jad;
  144. text/vnd.wap.wml wml;
  145. text/x-component htc;
  146.  
  147. image/png png;
  148. image/tiff tif tiff;
  149. image/vnd.wap.wbmp wbmp;
  150. image/x-icon ico;
  151. image/x-jng jng;
  152. image/x-ms-bmp bmp;
  153. image/svg+xml svg svgz;
  154. image/webp webp;
  155.  
  156. application/font-woff woff;
  157. application/java-archive jar war ear;
  158. application/json json;
  159. application/mac-binhex40 hqx;
  160. application/msword doc;
  161. application/pdf pdf;
  162. application/postscript ps eps ai;
  163. application/rtf rtf;
  164. application/vnd.apple.mpegurl m3u8;
  165. application/vnd.ms-excel xls;
  166. application/vnd.ms-fontobject eot;
  167. application/vnd.ms-powerpoint ppt;
  168. application/vnd.wap.wmlc wmlc;
  169. application/vnd.google-earth.kml+xml kml;
  170. application/vnd.google-earth.kmz kmz;
  171. application/x-7z-compressed 7z;
  172. application/x-cocoa cco;
  173. application/x-java-archive-diff jardiff;
  174. application/x-java-jnlp-file jnlp;
  175. application/x-makeself run;
  176. application/x-perl pl pm;
  177. application/x-pilot prc pdb;
  178. application/x-rar-compressed rar;
  179. application/x-redhat-package-manager rpm;
  180. application/x-sea sea;
  181. application/x-shockwave-flash swf;
  182. application/x-stuffit sit;
  183. application/x-tcl tcl tk;
  184. application/x-x509-ca-cert der pem crt;
  185. application/x-xpinstall xpi;
  186. application/xhtml+xml xhtml;
  187. application/xspf+xml xspf;
  188. application/zip zip;
  189.  
  190. application/octet-stream bin exe dll;
  191. application/octet-stream deb;
  192. application/octet-stream dmg;
  193. application/octet-stream iso img;
  194. application/octet-stream msi msp msm;
  195.  
  196. application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
  197. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
  198. application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
  199.  
  200. audio/midi mid midi kar;
  201. audio/mpeg mp3;
  202. audio/ogg ogg;
  203. audio/x-m4a m4a;
  204. audio/x-realaudio ra;
  205.  
  206. video/3gpp 3gpp 3gp;
  207. video/mp2t ts;
  208. video/mp4 mp4;
  209. video/mpeg mpeg mpg;
  210. video/quicktime mov;
  211. video/webm webm;
  212. video/x-flv flv;
  213. video/x-m4v m4v;
  214. video/x-mng mng;
  215. video/x-ms-asf asx asf;
  216. video/x-ms-wmv wmv;
  217. video/x-msvideo avi;
  218. }
  219.  
  220. # configuration file /etc/nginx/conf.d/proxy.conf:
  221. client_max_body_size 50M;
  222.  
  223. # configuration file /etc/nginx/conf.d/virtual.conf:
  224. #
  225. # A virtual host using mix of IP-, name-, and port-based configuration
  226. #
  227.  
  228. #server {
  229. # listen 8000;
  230. # listen somename:8080;
  231. # server_name somename alias another.alias;
  232.  
  233. # location / {
  234. # root html;
  235. # index index.html index.htm;
  236. # }
  237. #}
  238.  
  239.  
  240. # configuration file /etc/nginx/conf.d/webapp.conf:
  241. upstream my_app {
  242. server unix:///var/run/puma/my_app.sock;
  243. }
  244.  
  245. server {
  246. listen 80;
  247. server_name _ localhost; # need to listen to localhost for worker tier
  248.  
  249. location / {
  250. proxy_pass http://my_app; # match the name of upstream directive which is defined above
  251. proxy_set_header Host $host;
  252. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  253. }
  254.  
  255. location /assets {
  256. alias /var/app/current/public/assets;
  257. gzip_static on;
  258. gzip on;
  259. expires max;
  260. add_header Cache-Control public;
  261. }
  262.  
  263. location /public {
  264. alias /var/app/current/public;
  265. gzip_static on;
  266. gzip on;
  267. expires max;
  268. add_header Cache-Control public;
  269. }
  270. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement