Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- pid /run/nginx.pid;
- worker_processes auto;
- worker_rlimit_nofile 409600;
- events {
- worker_connections 4096;
- multi_accept on;
- }
- http {
- charset utf-8;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- server_tokens off;
- log_not_found off;
- types_hash_max_size 2048;
- client_max_body_size 16M;
- # MIME
- include mime.types;
- default_type application/octet-stream;
- # logging
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log warn;
- # load configs
- include /etc/nginx/conf.d/*.conf;
- # bot.remu.re
- server {
- listen 80;
- listen [::]:80;
- server_name bot.remu.re;
- set $base /var/www/bot;
- root $base/;
- # $uri, index.html
- location / {
- try_files $uri $uri/ /index.html;
- }
- # security headers
- add_header X-Frame-Options "SAMEORIGIN" always;
- add_header X-XSS-Protection "1; mode=block" always;
- add_header X-Content-Type-Options "nosniff" always;
- add_header Referrer-Policy "no-referrer-when-downgrade" always;
- add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
- # . files
- location ~ /\. {
- deny all;
- }
- # assets, media
- location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
- expires 7d;
- access_log off;
- }
- # svg, fonts
- location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff|woff2)$ {
- add_header Access-Control-Allow-Origin "*";
- expires 7d;
- access_log off;
- }
- # gzip
- gzip on;
- gzip_vary on;
- gzip_proxied any;
- gzip_comp_level 6;
- gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
- # handle .php
- location ~ \.php$ {
- try_files $uri =404;
- # fastcgi
- fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
- fastcgi_index index.php;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PHP_ADMIN_VALUE open_basedir=$base/:/usr/lib/php/:/tmp/;
- fastcgi_intercept_errors off;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 16k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- # default fastcgi_params
- include fastcgi_params;
- }
- }
- # api.bot.remu.re
- server {
- listen 80;
- listen [::]:80;
- server_name api.bot.remu.re;
- set $base /var/www/bot_data;
- root $base/;
- # $uri, index.html
- location / {
- try_files $uri $uri/ /index.html;
- }
- # security headers
- add_header X-Frame-Options "SAMEORIGIN" always;
- add_header X-XSS-Protection "1; mode=block" always;
- add_header X-Content-Type-Options "nosniff" always;
- add_header Referrer-Policy "no-referrer-when-downgrade" always;
- add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
- # . files
- location ~ /\. {
- deny all;
- }
- # assets, media
- location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
- expires 7d;
- access_log off;
- }
- # svg, fonts
- location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff|woff2)$ {
- add_header Access-Control-Allow-Origin "*";
- expires 7d;
- access_log off;
- }
- # gzip
- gzip on;
- gzip_vary on;
- gzip_proxied any;
- gzip_comp_level 6;
- gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
- # handle .php
- location ~ \.php$ {
- try_files $uri =404;
- # fastcgi
- fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
- fastcgi_index index.php;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PHP_ADMIN_VALUE open_basedir=$base/:/usr/lib/php/:/tmp/;
- fastcgi_intercept_errors off;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 16k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- # default fastcgi_params
- include fastcgi_params;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement