Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
1st attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybrad committed May 28, 2020
1 parent ed3c6e4 commit 6087d63
Showing 1 changed file with 53 additions and 13 deletions.
66 changes: 53 additions & 13 deletions internal/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,71 @@ write_files:
ALTER USER nitro WITH SUPERUSER;
- path: /opt/nitro/nginx/template.conf
content: |
# Hat tip to https://github.com/nystudio107/nginx-craft
server {
# Listen for both IPv4 & IPv6 on port 80
listen 80;
listen [::]:80;
# General virtual host settings
server_name CHANGESERVERNAME;
root CHANGEWEBROOTDIR;
index index.php;
index index.html index.htm index.php;
charset utf-8;
# Enable serving of static gzip files as per: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html
gzip_static on;
error_page 404 /index.php?$query_string;
# Enable server-side includes as per: http://nginx.org/en/docs/http/ngx_http_ssi_module.html
ssi on;
server_name CHANGESERVERNAME;
client_max_body_size 100M;
# Disable limits on the maximum allowed size of the client request body
client_max_body_size 0;
# 404 error handler
error_page 404 /index.php$is_args$args;
# Root directory location handler
location / {
try_files $uri $uri/ /index.php$is_args$args;
try_files $uri/index.html $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/phpCHANGEPHPVERSION-fpm.sock;
fastcgi_read_timeout 240;
fastcgi_param CRAFT_NITRO 1;
fastcgi_param DB_USER nitro;
fastcgi_param DB_PASSWORD nitro;
# php-fpm configuration
location ~ [^/]\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/phpCHANGEPHPVERSION-fpm.sock;
# FastCGI params
fastcgi_param CRAFT_NITRO 1;
fastcgi_param DB_USER nitro;
fastcgi_param DB_PASSWORD nitro;
fastcgi_param HTTP_PROXY "";
fastcgi_param HTTP_HOST CHANGESERVERNAME;
# Don't allow browser caching of dynamically generated content
add_header Last-Modified $date_gmt;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
if_modified_since off;
expires off;
etag off;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 240;
fastcgi_send_timeout 240;
fastcgi_read_timeout 240;
}
# Disable reading of Apache .htaccess files
location ~ /\.ht {
deny all;
}
# Misc settings
sendfile off;
}
- path: /opt/nitro/php-xdebug.ini
content: |
Expand Down

0 comments on commit 6087d63

Please # to comment.