adding bare minimum nginx config

This commit is contained in:
2024-02-24 03:49:30 +01:00
parent b04230320d
commit b02c654119

View File

@@ -93,42 +93,26 @@ listen.group = w0bm
## NGINX ## NGINX
First you have to create a config file in `/etc/nginx/conf.d/` First of all edit the nginx.conf and add the following inside of the http context
`sudo nvim /etc/nginx/conf.d/w0bm.conf` `include w0bm.conf`
This config is for the use with a reverse proxy intended. Then create the w0bm config file in `/etc/nginx/`
`sudo nvim /etc//w0bm.conf`
These are the bare minimum configuration settings for w0bm to work with nginx
<pre> <pre>
#w0bm.com Configuration
server { server {
listen 80; listen 80 default_server;
listen [::]:80; server_name _;
server_name w0bm.com www.w0bm.com v4.w0bm.com;
include letsencrypt.conf;
large_client_header_buffers 4 32k;
return 301 https://w0bm.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name w0bm.com www.w0bm.com v4.w0bm.com;
access_log /var/log/nginx/w0bm/w0bm-access.log; access_log /var/log/nginx/w0bm/w0bm-access.log;
root /home/w0bm/w0bm.com/public; error_log /var/log/nginx/w0bm/w0bm-error.log;
error_log /var/log/nginx_w0bm_error.log; root /home/w0bm/w0bm/public;
index index.php; index index.php;
client_max_body_size 500M; client_max_body_size 500M;
gzip on; gzip on;
ssl on;
ssl_certificate /path/to/your/cert.pem;
ssl_certificate_key /path/to/your/key.pem;
ssl_session_timeout 1d;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
large_client_header_buffers 4 32k; large_client_header_buffers 4 32k;
location ~ \.php$ { location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
@@ -137,7 +121,7 @@ server {
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
#fastcgi_param GEOIP_ADDR $remote_addr; #fastcgi_param GEOIP_ADDR $remote_addr;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_pass unix:/run/php71-fpm/php-fpm.sock;
} }
location ~* \.(?:css|js)$ { location ~* \.(?:css|js)$ {
gzip on; gzip on;
@@ -150,13 +134,9 @@ server {
add_header Cache-Control "public"; add_header Cache-Control "public";
} }
location / { location / {
if ($http_user_agent ~* 'MSIE ([1-9]|10)\.') {
return 302 https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support;
}
try_files $uri $uri/ /index.php?$args; try_files $uri $uri/ /index.php?$args;
} }
} }
</pre> </pre>
@@ -173,7 +153,6 @@ server {
For your local development instance make sure that you change 'secure' => true, to 'secure' => false, in `config/session.php` otherwise it will not let you log in! For your local development instance make sure that you change 'secure' => true, to 'secure' => false, in `config/session.php` otherwise it will not let you log in!
Create the .env file with the following content Create the .env file with the following content
<pre> <pre>
@@ -203,6 +182,7 @@ RECAPTCHA_PRIVATE=
Now put some random webm in the folder and name it `1.webm` Now put some random webm in the folder and name it `1.webm`
`mkdir public/thumbs` `mkdir public/thumbs`
`mkdir public/thumbs/beta` `mkdir public/thumbs/beta`
Modify `database/seeds/DatabaseSeeder.php` and uncomment all the different seeders. (Initially you'll need all) Modify `database/seeds/DatabaseSeeder.php` and uncomment all the different seeders. (Initially you'll need all)