Last active
June 24, 2024 19:58
-
-
Save x86demon/96f26aec0311ddebaa925d328fd04420 to your computer and use it in GitHub Desktop.
nginx server config for monolitic repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; | |
fastcgi_param DOCUMENT_ROOT $document_root; | |
fastcgi_param SERVER_PROTOCOL $server_protocol; | |
fastcgi_param REQUEST_SCHEME $scheme; | |
fastcgi_param HTTPS $https if_not_empty; | |
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | |
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | |
fastcgi_param REMOTE_ADDR $remote_addr; | |
fastcgi_param REMOTE_PORT $remote_port; | |
fastcgi_param SERVER_ADDR $server_addr; | |
fastcgi_param SERVER_PORT $server_port; | |
fastcgi_param SERVER_NAME $server_name; | |
# PHP only, required if PHP was built with --enable-force-cgi-redirect | |
fastcgi_param REDIRECT_STATUS 200; | |
# httpoxy mitigation (https://httpoxy.org/ https://www.nginx.com/blog/?p=41962) | |
fastcgi_param HTTP_PROXY ""; | |
fastcgi_buffers 4 512k; | |
fastcgi_buffer_size 256k; | |
fastcgi_busy_buffers_size 512k; | |
fastcgi_read_timeout 60m; | |
fastcgi_pass unix:/run/php-fpm.socket; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name "~^(?<application>[a-zA-Z0-9_-]+)\.(?<folder>\w+)\.loc$"; | |
root /var/www/projects/oro-mono/$folder/application/$application/public; | |
types_hash_max_size 2048; | |
client_max_body_size 512m; | |
client_body_buffer_size 10m; | |
fastcgi_connect_timeout 900s; | |
fastcgi_read_timeout 900s; | |
fastcgi_send_timeout 900s; | |
send_timeout 900s; | |
gzip_proxied any; | |
gzip_types text/plain text/xml text/css application/javascript application/json; | |
gzip_vary on; | |
index index.php; | |
location / { | |
try_files $uri /index.php$is_args$args; | |
} | |
location ~ ^/(index|index_dev|tracking)\.php(/|$) { | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_param ORO_TRACKING_DATA_FOLDER /tmp; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
fastcgi_param DOCUMENT_ROOT $realpath_root; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only Latin letter, numbers,
_
and-
are allowed in path