Advertisement
asanchez75

nginx

Jan 3rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. nginx -s reload
  2. https://drupal.stackexchange.com/questions/228039/nginx-clean-urls-dont-work
  3. https://www.nginx.com/resources/admin-guide/processes-and-runtime-control/
  4. https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
  5. nano -c /etc/nginx/hosts.d/default.conf
  6.  
  7. server {
  8. listen 80 default_server;
  9. listen 81 default_server http2 proxy_protocol; ## Needed when behind HAProxy with SSL termination + HTTP/2 support
  10. listen 443 default_server ssl http2;
  11.  
  12. ssl_certificate /etc/nginx/ssl/dummy.crt;
  13. ssl_certificate_key /etc/nginx/ssl/dummy.key;
  14.  
  15. root /data/www/default;
  16. index index.php index.html;
  17.  
  18.  
  19.  
  20.  
  21. location / {
  22. try_files $uri /index.php?$query_string;
  23. }
  24.  
  25. location @rewrite {
  26. rewrite ^/(.*)$ /index.php?q=$1;
  27. }
  28.  
  29. # Fighting with Styles? This little gem is amazing.
  30. location ~ ^/sites/.*/files/styles/ {
  31. try_files $uri @rewrite;
  32. }
  33.  
  34. # Handle private files through Drupal. Private file's path can come
  35. # with a language prefix.
  36. location ~ ^(/[a-z\-]+)?/system/files/ {
  37. try_files $uri /index.php?$query_string;
  38. }
  39.  
  40. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  41. expires max;
  42. log_not_found off;
  43. }
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. include /etc/nginx/conf.d/default-*.conf;
  53. include /data/conf/nginx/conf.d/default-*.conf;
  54.  
  55. # PHP backend is not in the default-*.conf file set,
  56. # as some vhost might not want to include it.
  57. include /etc/nginx/conf.d/php-location.conf;
  58.  
  59. # Import configuration files for status pages for Nginx and PHP-FPM
  60. include /etc/nginx/conf.d/stub-status.conf;
  61. include /etc/nginx/conf.d/fpm-status.conf;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement