Dock nginx config

## docker pull alograg/work:npm # configuration file /etc/nginx/nginx.conf: user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; # CORS allow add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUT, DELETE, HEAD'; add_header Access-Control-Allow-Credentials 'true'; add_header Access-Control-Allow-Headers 'Origin,Content-Type,Accept,Authorization'; if ($request_method = 'OPTIONS') { add_header Access-Control-Max-Age '1728000'; add_header Content-Type 'text/plain; charset=UTF-8'; add_header Content-Length '0'; return 204; } include /etc/nginx/conf.d/*.conf; } # configuration file /etc/nginx/conf.d/00-general.conf: client_max_body_size 50M; tcp_nopush on; tcp_nodelay on; types_hash_max_size 2048; # configuration file /etc/nginx/conf.d/10-gzip.conf: ## # Gzip Settings ## gzip on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types application/javascript application/rss+xml application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/opentype font/otf font/ttf image/svg+xml image/x-icon text/css text/javascript text/plain text/xml; # make sure gzip does not lose large gzipped js or css files # see http://blog.leetsoft.com/2007/07/25/nginx-gzip-ssl.html gzip_buffers 16 8k; # Disable gzip for certain browsers. gzip_disable “MSIE [1-6].(?!.*SV1)”; # configuration file /etc/nginx/conf.d/20-php74.conf: upstream php74 { server php74:9000; } # configuration file /etc/nginx/conf.d/31-storage.conf: server { listen 80; listen [::]:80; server_name storage.localhost; charset utf-8; root /var/www/html/storage/app/; # File index in JSON location / { alias /var/www/html/storage/app/public/; index ___i; # we really need no index here, just listing files autoindex on; autoindex_format json; autoindex_exact_size on; autoindex_localtime off; disable_symlinks off; } } # configuration file /etc/nginx/conf.d/32-laravel.conf: server { listen 80; listen [::]:80; server_name .localhost; server_name ~^(?<subdomain>.+)\.localhost$; client_max_body_size 150M; charset utf-8; root /var/www/html/public; include conf.d/modules/default.conf; location / { try_files $uri /index.php?$args; # Pass the arguments } location ~ "^/index\.php$" { try_files $uri =404; # include conf.d/block.conf fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass php74; fastcgi_intercept_errors off; fastcgi_index index.php; fastcgi_buffers 8 16k; # increase the buffer size for PHP-FTP fastcgi_buffer_size 32k; # increase the buffer size for PHP-FTP fastcgi_connect_timeout 360; fastcgi_read_timeout 420; # Se amplio a 7 mins por el envio de correos fastcgi_param primaryDomain localhost; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one location ~ /\.ht { deny all; } } # configuration file /etc/nginx/conf.d/modules/default.conf: index index.html index.php index.htm; location = /favicon.ico { log_not_found off; access_log off; allow all; } location = /robots.txt { log_not_found off; access_log off; allow all; } location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ { access_log off; log_not_found off; expires 365d; } # disallow access to apache configs location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ { deny all; } # disallow access to git configs path location ~ /\.git { deny all; } location ~ ^/(status|ping)$ { allow 127.0.0.1; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; fastcgi_pass php74; } # configuration file /etc/nginx/conf.d/modules/block.conf: limit_except GET HEAD { auth_basic 'Restricted'; auth_basic_user_file /usr/share/nginx/.htpasswd; }
es-MX: Condiguracion de NGINX para desarrollos locales con docker
en-US: NGINX configuration for local developments with docker
fr-FR: Configuration NGINX pour les développements locaux avec docker

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.