Advertisement
Al0rse

nginx.conf instance Symfony

Oct 18th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. # For more information on configuration, see:
  2. # * Official English Documentation: http://nginx.org/en/docs/
  3. # * Official Russian Documentation: http://nginx.org/ru/docs/
  4.  
  5. #user nginx;
  6. worker_processes auto;
  7. error_log /var/log/nginx/error.log;
  8. pid /var/run/nginx.pid;
  9.  
  10. events {
  11. worker_connections 1024;
  12.  
  13.  
  14. }
  15.  
  16. http {
  17. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  18. '$status $body_bytes_sent "$http_referer" '
  19. '"$http_user_agent" "$http_x_forwarded_for"';
  20.  
  21. access_log /var/log/nginx/access.log main;
  22. error_log /var/log/nginx/error.log;
  23.  
  24. sendfile on;
  25. tcp_nopush on;
  26. tcp_nodelay on;
  27. keepalive_timeout 65;
  28. types_hash_max_size 2048;
  29. client_max_body_size 20M;
  30.  
  31. include /etc/nginx/mime.types;
  32. default_type application/octet-stream;
  33.  
  34. # Load modular configuration files from the /etc/nginx/conf.d directory.
  35. # See http://nginx.org/en/docs/ngx_core_module.html#include
  36. # for more information.
  37. include /etc/nginx/conf.d/*.conf;
  38.  
  39. index index.php index.html index.htm;
  40.  
  41. server {
  42. listen 80 default_server;
  43. listen [::]:80 default_server;
  44. server_name localhost;
  45. root /usr/share/nginx/html;
  46.  
  47. # Load configuration files for the default server block.
  48. include /etc/nginx/default.d/*.conf;
  49.  
  50. location / {
  51. autoindex on;
  52. try_files $uri $uri/ /index.php?$args;
  53.  
  54. }
  55.  
  56. location /sites {
  57. autoindex on;
  58. }
  59.  
  60. # redirect server error pages to the static page /40x.html
  61. #
  62. error_page 404 /404.html;
  63. location = /40x.html {
  64. }
  65.  
  66. # redirect server error pages to the static page /50x.html
  67. #
  68. error_page 500 502 503 504 /50x.html;
  69. location = /50x.html {
  70. }
  71.  
  72. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  73. #
  74. location ~ \.php$ {
  75. fastcgi_pass 127.0.0.1:9000;
  76. fastcgi_index index.php;
  77. fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
  78. include fastcgi_params;
  79. }
  80.  
  81. # Media: images, icons, video, audio, HTC
  82. location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
  83. expires 10y;
  84. access_log off;
  85. add_header Cache-Control "public";
  86. }
  87.  
  88. # CSS and Javascript
  89. location ~* \.(?:css|js|jsx)$ {
  90. expires 1M;
  91. access_log off;
  92. add_header Cache-Control "public";
  93. }
  94. }
  95. # Aqui esta la configuracion de los donimios y subdominios.
  96. include /etc/nginx/sites-enabled/*.conf;
  97. server_names_hash_bucket_size 64;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement