Guest User

nginx error

a guest
Jul 3rd, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.29 KB | None | 0 0
  1. Коллеги, всем доброго, подскажите куда копать, в access.log стали сыпаться сообщения:
  2. 192.168.0.1 - - [03/Jul/2023:00:00:06 +0400] "OPTIONS / HTTP/1.0" 301 162 "-" "-"
  3. которые забивают весь логи, читать не возможно.
  4.  
  5.  
  6. nginx -v
  7. nginx version: nginx/1.18.0
  8.  
  9. nginx -t
  10. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  11. nginx: configuration file /etc/nginx/nginx.conf test is successful
  12.  
  13.  
  14. nginx -T
  15. # configuration file /etc/nginx/nginx.conf:
  16. user www-data;
  17. worker_processes 1;
  18. pid /var/run/nginx.pid;
  19.  
  20. events {
  21. worker_connections 1024;
  22. }
  23.  
  24. http {
  25. include /etc/nginx/conf-enabled/*.conf;
  26. include /etc/nginx/sites-enabled/*.conf;
  27. }
  28.  
  29. # configuration file /etc/nginx/conf-enabled/0-general.conf:
  30. map_hash_bucket_size 1024;
  31.  
  32. # configuration file /etc/nginx/conf-enabled/cache.conf:
  33. map $sent_http_content_type $expires {
  34. default off;
  35. application/x-javascript 1d;
  36. text/css 1d;
  37. ~image/ 1d;
  38. }
  39.  
  40. expires $expires;
  41.  
  42. # configuration file /etc/nginx/conf-enabled/client_max_body_size.conf:
  43. client_max_body_size 35m;
  44.  
  45. # configuration file /etc/nginx/conf-enabled/default_type.conf:
  46. default_type application/octet-stream;
  47.  
  48. # configuration file /etc/nginx/conf-enabled/gzip.conf:
  49. gzip on;
  50. gzip_vary on;
  51. gzip_http_version 1.0;
  52. gzip_comp_level 6;
  53. gzip_buffers 16 8k;
  54. gzip_min_length 10240;
  55. gzip_proxied any;
  56. gzip_disable "MSIE [1-6]\.";
  57.  
  58. # text/html is always compressed.
  59. gzip_types
  60. text/plain
  61. text/css
  62. text/xml
  63. text/javascript
  64. text/json
  65. text/vcard
  66. text/cache-manifest
  67. text/vnd.rim.location.xloc
  68. text/vtt
  69. text/x-component
  70. text/x-cross-domain-policy
  71. image/bmp
  72. image/vnd.microsoft.icon
  73. image/x-icon
  74. image/svg+xml
  75. font/truetype
  76. font/opentype
  77. application/atom+xml
  78. application/javascript
  79. application/json
  80. application/ld+json
  81. application/vnd.geo+json
  82. application/manifest+json
  83. application/x-javascript
  84. application/x-font-ttf
  85. application/x-web-app-manifest+json
  86. application/xml
  87. application/xml+rss
  88. application/xhtml+xml
  89. application/vnd.ms-fontobject;
  90.  
  91. # configuration file /etc/nginx/conf-enabled/headers.conf:
  92. add_header X-Frame-Options sameorigin;
  93. add_header X-Content-Type-Options nosniff;
  94. add_header X-XSS-Protection '1; mode=block';
  95. add_header X-Download-Options noopen;
  96. add_header X-Permitted-Cross-Domain-Policies none;
  97. add_header Content-Security-Policy "default-src https: data: 'unsafe-inline' 'unsafe-eval'";
  98. add_header Referrer-Policy strict-origin;
  99.  
  100. # configuration file /etc/nginx/conf-enabled/log.conf:
  101. access_log /var/log/nginx/access.log;
  102. error_log /var/log/nginx/error.log;
  103.  
  104. # configuration file /etc/nginx/conf-enabled/mime_types.conf:
  105. include /etc/nginx/mime.types;
  106.  
  107. # configuration file /etc/nginx/mime.types:
  108.  
  109. types {
  110. text/html html htm shtml;
  111. text/css css;
  112. text/xml xml;
  113. image/gif gif;
  114. image/jpeg jpeg jpg;
  115. application/javascript js;
  116. application/atom+xml atom;
  117. application/rss+xml rss;
  118.  
  119. text/mathml mml;
  120. text/plain txt;
  121. text/vnd.sun.j2me.app-descriptor jad;
  122. text/vnd.wap.wml wml;
  123. text/x-component htc;
  124.  
  125. image/png png;
  126. image/tiff tif tiff;
  127. image/vnd.wap.wbmp wbmp;
  128. image/x-icon ico;
  129. image/x-jng jng;
  130. image/x-ms-bmp bmp;
  131. image/svg+xml svg svgz;
  132. image/webp webp;
  133.  
  134. application/font-woff woff;
  135. application/java-archive jar war ear;
  136. application/json json;
  137. application/mac-binhex40 hqx;
  138. application/msword doc;
  139. application/pdf pdf;
  140. application/postscript ps eps ai;
  141. application/rtf rtf;
  142. application/vnd.apple.mpegurl m3u8;
  143. application/vnd.ms-excel xls;
  144. application/vnd.ms-fontobject eot;
  145. application/vnd.ms-powerpoint ppt;
  146. application/vnd.wap.wmlc wmlc;
  147. application/vnd.google-earth.kml+xml kml;
  148. application/vnd.google-earth.kmz kmz;
  149. application/x-7z-compressed 7z;
  150. application/x-cocoa cco;
  151. application/x-java-archive-diff jardiff;
  152. application/x-java-jnlp-file jnlp;
  153. application/x-makeself run;
  154. application/x-perl pl pm;
  155. application/x-pilot prc pdb;
  156. application/x-rar-compressed rar;
  157. application/x-redhat-package-manager rpm;
  158. application/x-sea sea;
  159. application/x-shockwave-flash swf;
  160. application/x-stuffit sit;
  161. application/x-tcl tcl tk;
  162. application/x-x509-ca-cert der pem crt;
  163. application/x-xpinstall xpi;
  164. application/xhtml+xml xhtml;
  165. application/xspf+xml xspf;
  166. application/zip zip;
  167.  
  168. application/octet-stream bin exe dll;
  169. application/octet-stream deb;
  170. application/octet-stream dmg;
  171. application/octet-stream iso img;
  172. application/octet-stream msi msp msm;
  173.  
  174. application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
  175. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
  176. application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
  177.  
  178. audio/midi mid midi kar;
  179. audio/mpeg mp3;
  180. audio/ogg ogg;
  181. audio/x-m4a m4a;
  182. audio/x-realaudio ra;
  183.  
  184. video/3gpp 3gpp 3gp;
  185. video/mp2t ts;
  186. video/mp4 mp4;
  187. video/mpeg mpeg mpg;
  188. video/quicktime mov;
  189. video/webm webm;
  190. video/x-flv flv;
  191. video/x-m4v m4v;
  192. video/x-mng mng;
  193. video/x-ms-asf asx asf;
  194. video/x-ms-wmv wmv;
  195. video/x-msvideo avi;
  196. }
  197.  
  198. # configuration file /etc/nginx/conf-enabled/php_fpm.conf:
  199. upstream php_workers {
  200. server 127.0.0.1:9999;
  201. }
  202.  
  203. # configuration file /etc/nginx/conf-enabled/sendfile.conf:
  204. sendfile on;
  205.  
  206. # configuration file /etc/nginx/conf-enabled/server_tokens.conf:
  207. # Hide Nginx version number
  208. server_tokens off;
  209.  
  210. # configuration file /etc/nginx/conf-enabled/types_hash_max_size.conf:
  211. types_hash_max_size 2048;
  212.  
  213. # configuration file /etc/nginx/sites-enabled/00-default-ssl.conf:
  214. #
  215. # Note: This file must be loaded before other virtual host config files,
  216. #
  217. # HTTPS
  218. server {
  219. listen 443 ssl http2 default_server;
  220. server_name 192.168.0.200;
  221.  
  222. root /var/www/html;
  223. index index.php index.html;
  224.  
  225. location ~ /.well-known {
  226. root /usr/share/nginx/html;
  227. allow all;
  228. }
  229. location /phpmyadmin {
  230. allow 127.0.0.1;
  231. allow 192.168.0.168;
  232. deny all;
  233. }
  234. location /alias {
  235. allow 127.0.0.1;
  236. allow 192.168.0.168;
  237. deny all;
  238. }
  239. location /whitelist {
  240. allow 127.0.0.1;
  241. allow 192.168.0.168;
  242. deny all;
  243. }
  244. location ~ ^/adminer {
  245. allow 127.0.0.1;
  246. allow 192.168.0.168;
  247. deny all;
  248. }
  249. location /postfixadmin {
  250. allow 127.0.0.1;
  251. allow 192.168.0.168;
  252. deny all;
  253. }
  254. include /etc/nginx/templates/misc.tmpl;
  255. include /etc/nginx/templates/ssl.tmpl;
  256. include /etc/nginx/templates/iredadmin.tmpl;
  257. include /etc/nginx/templates/roundcube.tmpl;
  258. include /etc/nginx/templates/sogo.tmpl;
  259. include /etc/nginx/templates/netdata.tmpl;
  260. include /etc/nginx/templates/php-catchall.tmpl;
  261. include /etc/nginx/templates/stub_status.tmpl;
  262. include /etc/nginx/templates/adminer.tmpl;
  263. }
  264.  
  265. # configuration file /etc/nginx/templates/misc.tmpl:
  266. # Allow access to '^/.well-known/'
  267. location ~ ^/.well-known/ {
  268. allow all;
  269. access_log off;
  270. log_not_found off;
  271. autoindex off;
  272. #root /var/www/html;
  273. }
  274. # Deny all attempts to access hidden files such as .htaccess.
  275. location ~ /\. { deny all; }
  276.  
  277. # Handling noisy messages
  278. location = /favicon.ico { access_log off; log_not_found off; }
  279. location = /robots.txt { access_log off; log_not_found off; }
  280.  
  281. # configuration file /etc/nginx/templates/ssl.tmpl:
  282. ssl_protocols TLSv1.2 TLSv1.3;
  283.  
  284. # Fix 'The Logjam Attack'.
  285. ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH;
  286. ssl_prefer_server_ciphers on;
  287. ssl_dhparam /etc/ssl/dh2048_param.pem;
  288.  
  289. # Greatly improve the performance of keep-alive connections over SSL.
  290. # With this enabled, client is not necessary to do a full SSL-handshake for
  291. # every request, thus saving time and cpu-resources.
  292. ssl_session_cache shared:SSL:10m;
  293.  
  294. # To use your own ssl cert (e.g. "Let's Encrypt"), please create symbol link to
  295. # ssl cert/key used below, so that we can manage this config file with Ansible.
  296. #
  297. # For example:
  298. #
  299. # rm -f /etc/ssl/private/iRedMail.key
  300. # rm -f /etc/ssl/certs/iRedMail.crt
  301. # ln -s /etc/letsencrypt/live/<domain>/privkey.pem /etc/ssl/private/iRedMail.key
  302. # ln -s /etc/letsencrypt/live/<domain>/fullchain.pem /etc/ssl/certs/iRedMail.crt
  303. #
  304. # To request free "Let's Encrypt" cert, please check our tutorial:
  305. # https://docs.iredmail.org/letsencrypt.html
  306. ssl_certificate /etc/ssl/certs/iRedMail.crt;
  307. ssl_certificate_key /etc/ssl/private/iRedMail.key;
  308.  
  309. # configuration file /etc/nginx/templates/iredadmin.tmpl:
  310. # Settings for iRedAdmin.
  311.  
  312. # static files under /iredadmin/static
  313. location ~ ^/iredadmin/static/(.*) {
  314. alias /opt/www/iredadmin/static/$1;
  315. }
  316.  
  317. # Python scripts
  318. location ~ ^/iredadmin(.*) {
  319. rewrite ^/iredadmin(/.*)$ $1 break;
  320.  
  321. include /etc/nginx/templates/hsts.tmpl;
  322.  
  323. include uwsgi_params;
  324. uwsgi_pass 127.0.0.1:7791;
  325. uwsgi_param UWSGI_CHDIR /opt/www/iredadmin;
  326. uwsgi_param UWSGI_SCRIPT iredadmin;
  327. uwsgi_param SCRIPT_NAME /iredadmin;
  328.  
  329. # Access control
  330. #allow 127.0.0.1;
  331. #allow 192.168.1.10;
  332. #allow 192.168.1.0/24;
  333. #deny all;
  334. }
  335.  
  336. # iRedAdmin: redirect /iredadmin to /iredadmin/
  337. location = /iredadmin {
  338. rewrite ^ /iredadmin/;
  339. }
  340.  
  341. # Handle newsletter-style subscription/unsubscription supported in iRedAdmin-Pro.
  342. location ~ ^/newsletter/ {
  343. rewrite /newsletter/(.*) /iredadmin/newsletter/$1 last;
  344. }
  345.  
  346. # configuration file /etc/nginx/templates/hsts.tmpl:
  347. # Use HTTP Strict Transport Security to force client to use secure
  348. # connections only. References:
  349. #
  350. # * RFC Document (6797): HTTP Strict Transport Security (HSTS)
  351. # https://tools.ietf.org/html/rfc6797#section-6.1.2
  352. #
  353. # * Short tutorial from Mozilla:
  354. # https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security
  355. #
  356. # WARNING: According to RFC document, HSTS will fail with self-signed SSL
  357. # certificate.
  358. # https://tools.ietf.org/html/rfc6797#page-27
  359. #
  360. # Syntax:
  361. #
  362. # Strict-Transport-Security: max-age=expireTime [; includeSubDomains] [; preload]
  363. add_header Strict-Transport-Security "max-age=31536000";
  364.  
  365. # configuration file /etc/nginx/uwsgi_params:
  366.  
  367. uwsgi_param QUERY_STRING $query_string;
  368. uwsgi_param REQUEST_METHOD $request_method;
  369. uwsgi_param CONTENT_TYPE $content_type;
  370. uwsgi_param CONTENT_LENGTH $content_length;
  371.  
  372. uwsgi_param REQUEST_URI $request_uri;
  373. uwsgi_param PATH_INFO $document_uri;
  374. uwsgi_param DOCUMENT_ROOT $document_root;
  375. uwsgi_param SERVER_PROTOCOL $server_protocol;
  376. uwsgi_param REQUEST_SCHEME $scheme;
  377. uwsgi_param HTTPS $https if_not_empty;
  378.  
  379. uwsgi_param REMOTE_ADDR $remote_addr;
  380. uwsgi_param REMOTE_PORT $remote_port;
  381. uwsgi_param SERVER_PORT $server_port;
  382. uwsgi_param SERVER_NAME $server_name;
  383.  
  384. # configuration file /etc/nginx/templates/roundcube.tmpl:
  385. #
  386. # Running Roundcube as a subfolder on an existing virtual host
  387. #
  388. # Block access to default directories and files under these directories
  389. location ~ ^/mail/(bin|config|installer|logs|SQL|temp|vendor)($|/.*) { deny all; }
  390.  
  391. # Block access to default files under top-directory and files start with same name.
  392. location ~ ^/mail/(CHANGELOG|composer.json|INSTALL|jsdeps.json|LICENSE|README|UPGRADING)($|.*) { deny all; }
  393.  
  394. # Block plugin config files and sample config files.
  395. location ~ ^/mail/plugins/.*/config.inc.php.* { deny all; }
  396.  
  397. # Block access to plugin data
  398. location ~ ^/mail/plugins/enigma/home($|/.*) { deny all; }
  399.  
  400. # Redirect URI `/mail` to `/mail/`.
  401. location = /mail {
  402. return 301 /mail/;
  403. }
  404.  
  405. location ~ ^/mail/(.*\.php)$ {
  406. include /etc/nginx/templates/hsts.tmpl;
  407. include /etc/nginx/templates/fastcgi_php.tmpl;
  408. fastcgi_param SCRIPT_FILENAME /opt/www/roundcubemail/$1;
  409. }
  410.  
  411. location ~ ^/mail/(.*) {
  412. alias /opt/www/roundcubemail/$1;
  413. index index.php;
  414. }
  415.  
  416. # configuration file /etc/nginx/templates/fastcgi_php.tmpl:
  417. #
  418. # Template used to handle PHP fastcgi applications
  419. #
  420. # You still need to define `SCRIPT_FILENAME` for your PHP application, and
  421. # probably `fastcgi_index` if your application use different index file.
  422. #
  423. include fastcgi_params;
  424.  
  425. # Directory index file
  426. fastcgi_index index.php;
  427.  
  428. # Handle PHP files with upstream handler
  429. fastcgi_pass php_workers;
  430.  
  431. # Fix the HTTPROXY issue.
  432. # Reference: https://httpoxy.org/
  433. fastcgi_param HTTP_PROXY '';
  434.  
  435. # configuration file /etc/nginx/fastcgi_params:
  436.  
  437. fastcgi_param QUERY_STRING $query_string;
  438. fastcgi_param REQUEST_METHOD $request_method;
  439. fastcgi_param CONTENT_TYPE $content_type;
  440. fastcgi_param CONTENT_LENGTH $content_length;
  441.  
  442. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  443. fastcgi_param REQUEST_URI $request_uri;
  444. fastcgi_param DOCUMENT_URI $document_uri;
  445. fastcgi_param DOCUMENT_ROOT $document_root;
  446. fastcgi_param SERVER_PROTOCOL $server_protocol;
  447. fastcgi_param REQUEST_SCHEME $scheme;
  448. fastcgi_param HTTPS $https if_not_empty;
  449.  
  450. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  451. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  452.  
  453. fastcgi_param REMOTE_ADDR $remote_addr;
  454. fastcgi_param REMOTE_PORT $remote_port;
  455. fastcgi_param REMOTE_USER $remote_user;
  456. fastcgi_param SERVER_ADDR $server_addr;
  457. fastcgi_param SERVER_PORT $server_port;
  458. fastcgi_param SERVER_NAME $server_name;
  459.  
  460. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  461. fastcgi_param REDIRECT_STATUS 200;
  462.  
  463. # configuration file /etc/nginx/templates/sogo.tmpl:
  464. # Settings for SOGo Groupware
  465.  
  466. # SOGo
  467. location ~ ^/sogo { rewrite ^ https://$host/SOGo; }
  468. location ~ ^/SOGO { rewrite ^ https://$host/SOGo; }
  469.  
  470. # Redirect /mail to /SOGo
  471. #location ~ ^/mail { rewrite ^ https://$host/SOGo; }
  472.  
  473. # For Mac OS X and iOS devices.
  474. rewrite ^/.well-known/caldav /SOGo/dav permanent;
  475. rewrite ^/.well-known/carddav /SOGo/dav permanent;
  476. rewrite ^/principals /SOGo/dav permanent;
  477.  
  478. location ^~ /SOGo {
  479. include /etc/nginx/templates/hsts.tmpl;
  480.  
  481. proxy_pass http://127.0.0.1:20000;
  482.  
  483. # forward user's IP address
  484. proxy_set_header X-Real-IP $remote_addr;
  485. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  486. proxy_set_header Host $host;
  487.  
  488. # always use https
  489. proxy_set_header x-webobjects-server-port $server_port;
  490. proxy_set_header x-webobjects-server-name $host;
  491. proxy_set_header x-webobjects-server-url https://$host;
  492. proxy_set_header x-webobjects-server-protocol HTTP/1.0;
  493.  
  494. proxy_busy_buffers_size 64k;
  495. proxy_buffers 8 64k;
  496. proxy_buffer_size 64k;
  497. }
  498.  
  499. location ^~ /Microsoft-Server-ActiveSync {
  500. proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
  501.  
  502. proxy_connect_timeout 3540;
  503. proxy_send_timeout 3540;
  504. proxy_read_timeout 3540;
  505.  
  506. proxy_busy_buffers_size 64k;
  507. proxy_buffers 8 64k;
  508. proxy_buffer_size 64k;
  509. }
  510.  
  511. location ^~ /SOGo/Microsoft-Server-ActiveSync {
  512. proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
  513.  
  514. proxy_connect_timeout 3540;
  515. proxy_send_timeout 3540;
  516. proxy_read_timeout 3540;
  517.  
  518. proxy_busy_buffers_size 64k;
  519. proxy_buffers 8 64k;
  520. proxy_buffer_size 64k;
  521. }
  522.  
  523. location /SOGo.woa/WebServerResources/ {
  524. alias /usr/lib/GNUstep/SOGo/WebServerResources/;
  525. expires max;
  526. }
  527. location /SOGo/WebServerResources/ {
  528. alias /usr/lib/GNUstep/SOGo/WebServerResources/;
  529. expires max;
  530. }
  531. location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ {
  532. alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
  533. expires max;
  534. }
  535.  
  536. # configuration file /etc/nginx/templates/netdata.tmpl:
  537. # Running netdata as a subfolder to an existing virtual host
  538. # FYI: https://github.com/firehol/netdata/wiki/Running-behind-nginx
  539.  
  540. location = /netdata {
  541. return 301 /netdata/;
  542. }
  543.  
  544. location ~ /netdata/(?<ndpath>.*) {
  545. proxy_redirect off;
  546. proxy_set_header Host $host;
  547.  
  548. proxy_set_header X-Forwarded-Host $host;
  549. proxy_set_header X-Forwarded-Server $host;
  550. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  551. proxy_http_version 1.1;
  552. proxy_pass_request_headers on;
  553. proxy_set_header Connection "keep-alive";
  554. proxy_store off;
  555. proxy_pass http://127.0.0.1:19999/$ndpath$is_args$args;
  556.  
  557. gzip on;
  558. gzip_proxied any;
  559. gzip_types *;
  560.  
  561. auth_basic "Authentication Required";
  562. auth_basic_user_file /etc/nginx/netdata.users;
  563. }
  564.  
  565. # configuration file /etc/nginx/templates/php-catchall.tmpl:
  566. # Normal PHP scripts
  567. location ~ \.php$ {
  568. include /etc/nginx/templates/fastcgi_php.tmpl;
  569.  
  570. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  571. }
  572.  
  573. # configuration file /etc/nginx/templates/stub_status.tmpl:
  574. location = /stub_status {
  575. stub_status on;
  576. access_log off;
  577. allow 127.0.0.1;
  578. deny all;
  579. }
  580.  
  581. location = /status {
  582. include fastcgi_params;
  583. fastcgi_pass php_workers;
  584. fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
  585. access_log off;
  586. allow 127.0.0.1;
  587. deny all;
  588. }
  589.  
  590. # configuration file /etc/nginx/templates/adminer.tmpl:
  591. # Sample setting for Adminer: http://adminer.org/
  592.  
  593. # -----------------------------------------
  594. # How to get it working:
  595. #
  596. # mkdir /opt/www/adminer
  597. # cd /opt/www/adminer
  598. # wget http://www.adminer.org/latest.php
  599. # chmod +x latest.php
  600. #
  601. # Warning: for security concern, it's recommended to change the URL '/adminer'
  602. # to another random string to avoid login attempts from bad guys.
  603. # for example, change the url to '^/HIoWCwogSHukIbGL'.
  604. #
  605. # -----------------------------------------
  606. # If you cannot login to MySQL server as root user:
  607. #
  608. # New MySQL or MariaDB support plugin authentication, by default, the root
  609. # account has setting `user.plugin=unix_socket` (in `mysql` database). The
  610. # `auth_socket` authentication plugin authenticates clients that connect from
  611. # the local host through the Unix socket file, this prevents access via network
  612. # connection, including Adminer. To make it working, please disable this
  613. # authentication plugin with sql commands below:
  614. #
  615. # sql> USE mysql;
  616. # sql> UPDATE user SET plugin='' WHERE User='root';
  617. #
  618. # Refer to MySQL document for more details:
  619. # https://dev.mysql.com/doc/refman/5.7/en/socket-authentication-plugin.html
  620.  
  621. location ~ ^/adminer {
  622. include fastcgi_params;
  623. fastcgi_pass php_workers;
  624. fastcgi_index latest.php;
  625. fastcgi_param SCRIPT_FILENAME /opt/www/adminer/latest.php;
  626.  
  627. # Access control
  628. #allow 127.0.0.1;
  629. #allow 192.168.1.10;
  630. #allow 192.168.1.0/24;
  631. #deny all;
  632. }
  633. location ~ ^/adminer.css$ {
  634. alias /opt/www/adminer/adminer.css;
  635. }
  636.  
  637. # configuration file /etc/nginx/sites-enabled/00-default.conf:
  638. #
  639. # Note: This file must be loaded before other virtual host config files,
  640. #
  641. # HTTP
  642. server {
  643. # Listen on ipv4
  644. listen 80;
  645. listen [::]:80;
  646.  
  647. server_name 192.168.0.200;
  648.  
  649. return 301 $https://mail.mycompany.ru$request_uri;
  650. }
  651.  
  652. # configuration file /etc/nginx/sites-enabled/postfixadmin.conf:
  653. server {
  654. listen 80;
  655. listen [::]:80;
  656. server_name postfixadmin;
  657.  
  658. root /var/www/html/postfixadmin/public/;
  659. index index.php index.html;
  660.  
  661. access_log /var/log/nginx/postfixadmin_access.log;
  662. error_log /var/log/nginx/postfixadmin_error.log;
  663.  
  664. location / {
  665. try_files $uri $uri/ /index.php;
  666. }
  667.  
  668. location ~ ^/(.+\.php)$ {
  669. try_files $uri =404;
  670. fastcgi_pass 127.0.0.1:9999;
  671. fastcgi_index index.php;
  672. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  673. include /etc/nginx/fastcgi_params;
  674. }
  675. }
  676.  
  677.  
Advertisement
Add Comment
Please, Sign In to add comment