Last active
February 21, 2020 07:21
-
-
Save Sebobo/fe9b301f11ac2c188926542f47c6b1f6 to your computer and use it in GitHub Desktop.
NGINX Neos CMS setup with includes
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
charset utf-8; | |
location ~ /\. { | |
access_log off; | |
log_not_found off; | |
deny all; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} |
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; | |
listen [::]:80; | |
server_name neos-dev.test; | |
root /Path/To/Workspace/NeosCMS/Neos/Web/; | |
include /Path/To/Workspace/dev-environment/nginx/includes/default.conf; | |
include /Path/To/Workspace/dev-environment/nginx/includes/neos.conf; | |
include /Path/To/Workspace/dev-environment/nginx/includes/php73.conf; | |
} |
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
location ~ "^/_Resources/" { | |
access_log off; | |
log_not_found off; | |
expires max; | |
break; | |
} |
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
user MYUSER nobody; | |
worker_processes 2; | |
error_log /usr/local/var/log/nginx/error.log warn; | |
pid /usr/local/var/run/nginx.pid; | |
events { | |
worker_connections 256; | |
} | |
http { | |
include /usr/local/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" ' | |
'$request_time $upstream_response_time $pipe'; | |
sendfile off; | |
server_tokens off; | |
keepalive_timeout 2; | |
client_body_buffer_size 50M; | |
client_max_body_size 50M; | |
allow 192.168.128.0/24; | |
allow 127.0.0.1; | |
allow ::1; | |
# drop rest of the world | |
deny all; | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_comp_level 5; | |
gzip_min_length 512; | |
gzip_buffers 4 8k; | |
gzip_proxied any; | |
gzip_types | |
text/css | |
text/plain | |
text/javascript | |
text/x-component | |
font/eot | |
font/opentype | |
application/javascript | |
application/json | |
application/xml | |
application/xhtml+xml | |
application/x-font-ttf | |
application/x-font-opentype | |
application/font-woff | |
application/octet-stream | |
application/vnd.ms-fontobject | |
image/svg+xml | |
image/x-icon; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
server { | |
listen 80 default_server; | |
server_name _; | |
return 444; | |
} | |
include /Path/To/Workspace/dev-environment/nginx/vhosts/*.conf; | |
} |
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
index index.php; | |
location / { | |
default_type "text/html"; | |
try_files /cache/$uri $uri $uri/ /index.php?$args; | |
} | |
location = / { | |
default_type "text/html"; | |
try_files /cache/index /index.php?$args; | |
} | |
location ~ \.php$ { | |
include fastcgi_params; | |
try_files $uri =404; | |
fastcgi_pass unix:/Users/MYUSER/.config/php73.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param FLOW_CONTEXT Development/Local; | |
fastcgi_param FLOW_REWRITEURLS 1; | |
fastcgi_param X-Forwarded-For $proxy_add_x_forwarded_for; | |
fastcgi_param X-Forwarded-Port $proxy_port; | |
fastcgi_param REMOTE_ADDR $remote_addr; | |
fastcgi_param REMOTE_PORT $remote_port; | |
fastcgi_param SERVER_ADDR $server_addr; | |
fastcgi_param SERVER_NAME $http_host; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_read_timeout 300; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 256 16k; | |
fastcgi_busy_buffers_size 256k; | |
fastcgi_temp_file_write_size 256k; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment