Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nginx -T
- nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
- nginx: configuration file /etc/nginx/nginx.conf test is successful
- # configuration file /etc/nginx/nginx.conf:
- user www-data;
- worker_processes auto;
- worker_priority -2;
- error_log /var/log/nginx/error.log notice;
- pid /var/run/nginx.pid;
- events {
- worker_connections 2048;
- multi_accept on;
- use epoll;
- }
- http {
- include /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" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log main;
- sendfile on;
- aio on;
- tcp_nopush on;
- keepalive_timeout 45;
- reset_timedout_connection on;
- client_body_timeout 35;
- send_timeout 30;
- open_file_cache max=100000 inactive=20s;
- open_file_cache_valid 45s;
- open_file_cache_min_uses 2;
- open_file_cache_errors on;
- include /etc/nginx/conf.d/*.conf;
- }
- # configuration file /etc/nginx/mime.types:
- types {
- text/html html htm shtml;
- text/css css;
- text/xml xml;
- image/gif gif;
- image/jpeg jpeg jpg;
- application/javascript js;
- application/atom+xml atom;
- application/rss+xml rss;
- text/mathml mml;
- text/plain txt;
- text/vnd.sun.j2me.app-descriptor jad;
- text/vnd.wap.wml wml;
- text/x-component htc;
- image/avif avif;
- image/png png;
- image/svg+xml svg svgz;
- image/tiff tif tiff;
- image/vnd.wap.wbmp wbmp;
- image/webp webp;
- image/x-icon ico;
- image/x-jng jng;
- image/x-ms-bmp bmp;
- font/woff woff;
- font/woff2 woff2;
- application/java-archive jar war ear;
- application/json json;
- application/mac-binhex40 hqx;
- application/msword doc;
- application/pdf pdf;
- application/postscript ps eps ai;
- application/rtf rtf;
- application/vnd.apple.mpegurl m3u8;
- application/vnd.google-earth.kml+xml kml;
- application/vnd.google-earth.kmz kmz;
- application/vnd.ms-excel xls;
- application/vnd.ms-fontobject eot;
- application/vnd.ms-powerpoint ppt;
- application/vnd.oasis.opendocument.graphics odg;
- application/vnd.oasis.opendocument.presentation odp;
- application/vnd.oasis.opendocument.spreadsheet ods;
- application/vnd.oasis.opendocument.text odt;
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- pptx;
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- xlsx;
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- docx;
- application/vnd.wap.wmlc wmlc;
- application/wasm wasm;
- application/x-7z-compressed 7z;
- application/x-cocoa cco;
- application/x-java-archive-diff jardiff;
- application/x-java-jnlp-file jnlp;
- application/x-makeself run;
- application/x-perl pl pm;
- application/x-pilot prc pdb;
- application/x-rar-compressed rar;
- application/x-redhat-package-manager rpm;
- application/x-sea sea;
- application/x-shockwave-flash swf;
- application/x-stuffit sit;
- application/x-tcl tcl tk;
- application/x-x509-ca-cert der pem crt;
- application/x-xpinstall xpi;
- application/xhtml+xml xhtml;
- application/xspf+xml xspf;
- application/zip zip;
- application/octet-stream bin exe dll;
- application/octet-stream deb;
- application/octet-stream dmg;
- application/octet-stream iso img;
- application/octet-stream msi msp msm;
- audio/midi mid midi kar;
- audio/mpeg mp3;
- audio/ogg ogg;
- audio/x-m4a m4a;
- audio/x-realaudio ra;
- video/3gpp 3gpp 3gp;
- video/mp2t ts;
- video/mp4 mp4;
- video/mpeg mpeg mpg;
- video/quicktime mov;
- video/webm webm;
- video/x-flv flv;
- video/x-m4v m4v;
- video/x-mng mng;
- video/x-ms-asf asx asf;
- video/x-ms-wmv wmv;
- video/x-msvideo avi;
- }
- # configuration file /etc/nginx/conf.d/admin.site.site.conf:
- map $sent_http_content_type $expires {
- "text/html" epoch;
- "text/html; charset=utf-8" epoch;
- default off;
- }
- server {
- listen 80;
- server_name admin.site.site;
- set $base /var/www;
- root $base/public;
- # security
- include nginx_configs/security.conf;
- # logging
- access_log /var/log/nginx/admin.site.site.access.log;
- error_log /var/log/nginx/admin.site.site.error.log warn;
- client_max_body_size 200M;
- location /storage {
- access_log off;
- expires 7d;
- }
- # index.html fallback
- location / {
- expires $expires;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_redirect off;
- proxy_read_timeout 1m;
- proxy_connect_timeout 1m;
- proxy_pass http://127.0.0.1:3001; # set the address of the Node.js
- }
- # api fallback
- location /api/ {
- try_files $uri $uri/ /index.php?$query_string;
- }
- # auth fallback
- location /auth/ {
- try_files $uri $uri/ /index.php?$query_string;
- }
- # handle .php
- location ~* \.php$ {
- fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT $realpath_root;
- include nginx_configs/php_fastcgi.conf;
- }
- }
- # configuration file /etc/nginx/nginx_configs/security.conf:
- # security headers
- #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 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;
- #add_header Permissions-Policy "interest-cohort=()" always;
- #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Content-Type-Options "nosniff";
- # . files
- location ~ /\.(?!well-known) {
- deny all;
- }
- # configuration file /etc/nginx/nginx_configs/php_fastcgi.conf:
- # 404
- try_files $fastcgi_script_name =404;
- # default fastcgi_params
- include fastcgi_params;
- # fastcgi settings
- fastcgi_index index.php;
- fastcgi_buffers 8 16k;
- fastcgi_buffer_size 32k;
- # fastcgi params
- fastcgi_param DOCUMENT_ROOT $realpath_root;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";
- # configuration file /etc/nginx/fastcgi_params:
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param SERVER_PROTOCOL $server_protocol;
- fastcgi_param REQUEST_SCHEME $scheme;
- fastcgi_param HTTPS $https if_not_empty;
- fastcgi_param GATEWAY_INTERFACE CGI/1.1;
- fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- # PHP only, required if PHP was built with --enable-force-cgi-redirect
- fastcgi_param REDIRECT_STATUS 200;
- # configuration file /etc/nginx/conf.d/site.site.conf:
- # cache settings
- include nginx_configs/cache.conf;
- map $sent_http_content_type $expires {
- "text/html" epoch;
- "text/html; charset=utf-8" epoch;
- default off;
- }
- map $http_user_agent $agent_prefix { default ""; "~^(?<prefix>.{4}).*$" $prefix;}
- map $http_user_agent $mobile_device {
- default Desktop;
- ~*iPad|iPad.*Mobile|^.*Android.*Nexus(((?:(?!Mobile))|(?:(\s(7|10).+))).)*$|SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1010|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P6810|GT-P7501|Kindle|Silk.*Accelerated|xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617|Android.*\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71)\b|Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|Sony\ Tablet|Sony\ Tablet\ S|SGPT12|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT211|SGPT213|EBRD1101|EBRD1102|EBRD1201|MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010|MediaPad|IDEOS\ S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|IQ310|Fly\ Vision|Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE\ U8GT|Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)|\bL-06C|LG-V900|LG-V909\|Android.*(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468)|Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|Android.*ARCHOS|101G9|80G9|NOVO7|Novo7Aurora|Novo7Basic|NOVO7PALADIN|Transformer|TF101\|PlayBook|RIM\ Tablet|HTC\ Flyer|HTC\ Jetstream|HTC-P715a|HTC\ EVO\ View\ 4G|PG41200|Android.*Nook|NookColor|nook\ browser|BNTV250A|LogicPD\ Zoom2|Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A|bq.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant)|Android.*\b97D\b|Tablet(?!.*PC)|ViewPad7|MID7015|BNTV250A|LogicPD\ Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|hp-tablet|Playstation|TB07STA|TB10STA|TB07FTA|TB10FTA|z1000|Z99\ 2G|z99|z930|z999|z990|z909|Z919|z900|TOUCHPAD.*[78910]|Broncho.*(N701|N708|N802|a710)|Pantech.*P4100|\bN-06D|\bN-08D|T-Hub2|Android.*\bNabi|Playstation.*(Portable|Vita) Tablet;
- ~*SM-N|Tapatalk|PDA|PPC|SAGEM|mmp|pocket|psp|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|wap|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser|LG-P500|iPhone.*Mobile|iPod|iTunes|BlackBerry|\bBB10\b|rim[0-9]+|HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6425|001HT|Inspire\ 4G|Android.*\bEVO\b|Nexus\ One|Nexus\ S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue\ Pro|Dell\ Flash|Dell\ Smoke|Dell\ Mini\ 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b|sony|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|Asus.*Galaxy|PalmSource|Palm|Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature|IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250|\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b|PANTECH|IM-A|VEGA\ PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790|Samsung|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E|GT-I|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-P6810|GT-P7100|GT-S|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R4|SCH-T300|SCH-U|SCS-26UC|SGH-A|SGH-B|SGH-C|SGH-D307|SGH-D|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N|SGH-N7|SGH-P|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T|SGH-U|SGH-V|SGH-X|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N8010|Motorola|\bDroid\b.*Build|DROIDX|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT3|XT502|XT530|XT531|XT532|XT535|XT6|XT7|XT8|XT9 Mobile;
- }
- server {
- listen 80 default_server;
- set $base /var/www;
- root $base/public;
- # Security
- include nginx_configs/security.conf;
- # Logging
- access_log /var/log/nginx/site.site.access.log;
- error_log /var/log/nginx/site.site.error.log warn;
- add_header X-Cache $upstream_cache_status;
- add_header X-Backend-Server $hostname;
- # Gzip
- include nginx_configs/gzip.conf;
- location /healthcheck {
- access_log off;
- return 200 "healthy\n";
- }
- rewrite ^/en/(.*)$ https://site.site/$1 permanent;
- location /en {
- return 301 https://site.site;
- }
- rewrite /results/africa/malawi/lilongwe /results/africa/malawi permanent;
- rewrite /results/europe/all-countries/tivat/all-specializations/procedures/aligners /results/europe/montenegro/all-cities/all-specializations/procedures/aligners permanent;
- if ($request_uri ~ 'jet-theme-core') {
- return 404;
- }
- location /storage {
- access_log off;
- add_header Cache-control "public";
- expires 7d;
- }
- location ~* /warm/sitemap.*.xml {
- root $base/storage/app/sitemap;
- }
- location ~* sitemap.*.xml {
- root $base/storage/app/sitemap/curr;
- }
- location /6fa701990472fc283181cb279b89bf40b4bce3-f.txt {
- root $base/storage/app/public;
- }
- proxy_buffering on;
- proxy_buffer_size 8000k;
- proxy_buffers 8 8000k;
- location / {
- expires $expires;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_redirect off;
- proxy_read_timeout 1m;
- proxy_connect_timeout 1m;
- proxy_pass http://127.0.0.1:3000; # set the address of the Node.js
- set $no_cache 0;
- #set $ignore_header "Cache-Control" "Expires" "Set-Cookie";
- set $hide_header "Set-Cookie";
- if ($request_uri ~* ".js|.css") {
- set $no_cache 1;
- }
- if ($request_uri ~* "no_cache=yes") {
- set $no_cache 1;
- }
- set $device "D";
- if ($agent_prefix ~* "/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i") {
- set $device "M";
- }
- if ($http_user_agent ~* "/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|FBAN|FBAV|fennec|hiptop|iemobile|ip(hone|od)|Instagram|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i") {
- set $device "M";
- }
- proxy_cache dg.proxy;
- proxy_cache_key "$mobile_device|$request_uri|$cookie_currency";
- proxy_cache_valid 200 302 301 304 7200h;
- proxy_cache_valid 404 500 0s;
- proxy_hide_header $hide_header;
- proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
- proxy_cache_bypass $no_cache;
- proxy_no_cache $no_cache;
- }
- # api fallback
- location /api/ {
- try_files $uri $uri/ /index.php?$query_string;
- }
- # auth fallback
- location /auth/ {
- try_files $uri $uri/ /index.php?$query_string;
- }
- # handle .php
- location ~* \.php$ {
- gzip on;
- fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT $realpath_root;
- include nginx_configs/php_fastcgi.conf;
- set $realip $remote_addr;
- if ($http_x_forwarded_for ~ "^(\d+\.\d+\.\d+\.\d+)") {
- set $realip $1;
- }
- fastcgi_param REMOTE_ADDR $realip;
- fastcgi_cache dg.fastcgi;
- fastcgi_cache_key "$request_method|$request_uri|$request_body|$cookie_currency|$http_X_Accept_Currency";
- fastcgi_cache_valid 200 302 301 304 72h;
- fastcgi_cache_methods GET POST HEAD;
- fastcgi_hide_header "Set-Cookie";
- fastcgi_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
- add_header X-Cached $upstream_cache_status;
- fastcgi_cache_bypass $arg__cache_bypass;
- }
- location ~ ^/(horizon|vendor|telescope)/ {
- auth_basic "Monitoring Content";
- auth_basic_user_file /etc/nginx/.htpasswd;
- try_files $uri /index.php?$query_string;
- }
- }
- # configuration file /etc/nginx/nginx_configs/cache.conf:
- fastcgi_cache_path
- /var/nginx_cache/fastcgi_cache
- levels=1:2
- keys_zone=dg.fastcgi:500m
- inactive=200000h
- max_size=200G;
- proxy_cache_path
- /var/nginx_cache/proxy_cache
- levels=1:2
- keys_zone=dg.proxy:500m
- inactive=200000h
- max_size=200G;
- # configuration file /etc/nginx/nginx_configs/gzip.conf:
- # gzip
- gzip on;
- gzip_disable "msie6";
- gzip_comp_level 6;
- gzip_min_length 1100;
- gzip_buffers 16 8k;
- gzip_proxied any;
- gzip_types
- text/plain
- text/css
- text/js
- application/json
- application/x-javascript
- application/javascript
- text/xml
- application/xml
- application/rss+xml
- text/javascript
- image/svg+xml
- application/vnd.ms-fontobject
- application/x-font-ttf
- font/opentype;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement