|
| 1 | +# default Docker DNS server |
| 2 | +resolver 127.0.0.11; |
| 3 | + |
| 4 | +# idea from https://github.com/developersalliance/magento2-dockergento/blob/master/config/dockergento/nginx/conf/default.conf |
| 5 | +map $cookie_XDEBUG_SESSION $fastcgi_pass { |
| 6 | + default app; |
| 7 | + wordpress app_xdebug; |
| 8 | +} |
| 9 | + |
| 10 | +server { |
| 11 | + listen 80 default_server; |
| 12 | + listen [::]:80 default_server; |
| 13 | + |
| 14 | + server_name php-xdebug-docker; |
| 15 | + root /var/www/html; |
| 16 | + |
| 17 | + index index.php; |
| 18 | + |
| 19 | + # https://github.com/h5bp/server-configs-nginx/blob/master/h5bp/web_performance/compression.conf |
| 20 | + gzip on; |
| 21 | + gzip_vary on; |
| 22 | + gzip_proxied any; |
| 23 | + gzip_comp_level 5; |
| 24 | + gzip_buffers 16 8k; |
| 25 | + gzip_min_length 256; |
| 26 | + gzip_types |
| 27 | + application/atom+xml |
| 28 | + application/geo+json |
| 29 | + application/javascript |
| 30 | + application/x-javascript |
| 31 | + application/json |
| 32 | + application/ld+json |
| 33 | + application/manifest+json |
| 34 | + application/rdf+xml |
| 35 | + application/rss+xml |
| 36 | + application/vnd.ms-fontobject |
| 37 | + application/wasm |
| 38 | + application/x-web-app-manifest+json |
| 39 | + application/xhtml+xml |
| 40 | + application/xml |
| 41 | + font/eot |
| 42 | + font/otf |
| 43 | + font/ttf |
| 44 | + image/bmp |
| 45 | + image/svg+xml |
| 46 | + text/cache-manifest |
| 47 | + text/calendar |
| 48 | + text/css |
| 49 | + text/javascript |
| 50 | + text/markdown |
| 51 | + text/plain |
| 52 | + text/xml |
| 53 | + text/vcard |
| 54 | + text/vnd.rim.location.xloc |
| 55 | + text/vtt |
| 56 | + text/x-component |
| 57 | + text/x-cross-domain-policy; |
| 58 | + |
| 59 | + location / { |
| 60 | + try_files $uri $uri/ /index.php?$args; |
| 61 | + } |
| 62 | + |
| 63 | + location ~ \.php$ { |
| 64 | + #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini |
| 65 | + include fastcgi_params; |
| 66 | + fastcgi_intercept_errors on; |
| 67 | + fastcgi_pass $fastcgi_pass:9000; |
| 68 | + |
| 69 | + fastcgi_split_path_info ^(.+\.php)(/.*)$; |
| 70 | + fastcgi_index index.php; |
| 71 | + |
| 72 | + fastcgi_param PATH_INFO $fastcgi_path_info; |
| 73 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 74 | + fastcgi_param DOCUMENT_ROOT $realpath_root; |
| 75 | + } |
| 76 | + |
| 77 | + client_max_body_size 10M; |
| 78 | + |
| 79 | + error_log /var/log/nginx/error.log; |
| 80 | + access_log /var/log/nginx/access.log; |
| 81 | +} |
0 commit comments