Skip to content

Commit

Permalink
Change the conf file location
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Oct 17, 2024
1 parent 08e291a commit 0a3dd75
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 90 deletions.
45 changes: 0 additions & 45 deletions root/defaults/nginx/site-confs/default.conf

This file was deleted.

45 changes: 0 additions & 45 deletions root/defaults/nginx/site-confs/default.conf.sample

This file was deleted.

125 changes: 125 additions & 0 deletions root/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
## Version 2024/05/27 - Changelog: https://github.com/linuxserver/docker-baseimage-alpine-nginx/commits/master/root/defaults/nginx/nginx.conf.sample

### Based on alpine defaults
# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.conf?h=3.20-stable

user abc;

# Set number of worker processes automatically based on number of CPU cores.
include /config/nginx/worker_processes.conf;

# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

# Configures default error logger.
error_log /config/log/nginx/error.log;

# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;

# Include files with config snippets into the root context.
include /etc/nginx/conf.d/*.conf;

events {
# The maximum number of simultaneous connections that can be opened by
# a worker process.
worker_connections 1024;
}

http {
# Includes mapping of file name extensions to MIME types of responses
# and defines the default type.
include /etc/nginx/mime.types;
default_type application/octet-stream;

# Name servers used to resolve names of upstream servers into addresses.
# It's also needed when using tcpsocket and udpsocket in Lua modules.
#resolver 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001;
include /config/nginx/resolver.conf;

# Don't tell nginx version to the clients. Default is 'on'.
server_tokens off;

# Specifies the maximum accepted body size of a client request, as
# indicated by the request header Content-Length. If the stated content
# length is greater than this size, then the client receives the HTTP
# error code 413. Set to 0 to disable. Default is '1m'.
client_max_body_size 0;

# Sendfile copies data between one FD and other from within the kernel,
# which is more efficient than read() + write(). Default is off.
sendfile on;

# Causes nginx to attempt to send its HTTP response head in one packet,
# instead of using partial frames. Default is 'off'.
tcp_nopush on;

# all ssl related config moved to ssl.conf
# included in server blocks where listen 443 is defined

# Enable gzipping of responses.
#gzip on;

# Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
gzip_vary on;

# Helper variable for proxying websockets.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

# Sets the path, format, and configuration for a buffered log write.
access_log /config/log/nginx/access.log;

# Includes virtual hosts configs.
include /etc/nginx/http.d/*.conf;

#include /config/nginx/site-confs/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;

listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name _;

include /config/nginx/ssl.conf;

set $root /app/www/public;
if (!-d /app/www/public) {
set $root /config/www;
}
root $root;
index index.html index.htm index.php;

location / {
# enable for basic auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;

try_files $uri $uri/ /index.html /index.php$is_args$args;
}

location ~ ^(.+\.php)(.*)$ {
try_files $fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}

location ~ ^/api/(.*)$ {
try_files $uri /api/index.php?endpoint=$1&$args;
}

# deny access to .htaccess/.htpasswd files
location ~ /\.ht {
deny all;
}
}
}

daemon off;
pid /run/nginx.pid;

0 comments on commit 0a3dd75

Please sign in to comment.