Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.44 KB | None | 0 0
  1. #user nginx;
  2.  
  3. worker_processes auto;
  4. pid /var/run/nginx.pid;
  5.  
  6. #error_log logs/error.log;
  7. #error_log logs/error.log notice;
  8. #error_log logs/error.log info;
  9.  
  10. events {
  11. worker_connections 10240;
  12. }
  13.  
  14.  
  15. http {
  16. include /etc/nginx/mime.types;
  17.  
  18. # For user configurations not maintained by DirectAdmin. Empty by default.
  19.  
  20.  
  21. # Supplemental configuration
  22.  
  23. default_type application/octet-stream;
  24. tcp_nopush on;
  25. tcp_nodelay on;
  26. sendfile on;
  27.  
  28. log_format bytes '$bytes_sent $request_length';
  29.  
  30. keepalive_timeout 15;
  31. types_hash_max_size 2048;
  32.  
  33. disable_symlinks if_not_owner from=$document_root;
  34.  
  35. server_tokens off;
  36.  
  37. client_max_body_size 1024m;
  38. client_body_buffer_size 128k;
  39.  
  40. server_names_hash_bucket_size 128;
  41. server_names_hash_max_size 10240;
  42.  
  43. ssl_dhparam /etc/nginx/ssl.crt/dhparams.pem;
  44.  
  45. ssl_session_cache shared:SSL:10m;
  46. ssl_session_timeout 5m;
  47.  
  48. proxy_read_timeout 1800s;
  49.  
  50. # https://mozilla.github.io/server-side-tls/ssl-config-generator/ intermediate configuration.
  51. ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  52. ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  53. ssl_prefer_server_ciphers on;
  54.  
  55. index index.html index.htm index.php;
  56.  
  57. gzip on;
  58. gzip_static on;
  59. gzip_disable "msie6";
  60. gzip_http_version 1.1;
  61. gzip_vary on;
  62. gzip_comp_level 1;
  63. gzip_proxied any;
  64. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/svg+xml;
  65. gzip_buffers 16 8k;
  66.  
  67.  
  68. server {
  69. listen 172.72.133.10:80;
  70. listen 127.0.0.1:80;
  71. #listen [::1]:80;
  72.  
  73. server_name $hostname 172.72.133.10;
  74.  
  75. root /var/www/html;
  76.  
  77. include /etc/nginx/nginx-userdir.conf;
  78.  
  79. # Pass all .php files onto a php-fpm/php-fcgi server.
  80. location ~ \.php$ {
  81. try_files $uri =404;
  82.  
  83. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  84. include /etc/nginx/fastcgi_params;
  85. fastcgi_index index.php;
  86. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  87. fastcgi_pass unix:/usr/local/php73/sockets/webapps.sock;
  88. }
  89.  
  90. location /nginx_status {
  91. # Enable nginx status page
  92. stub_status on;
  93.  
  94. # Disable status page logging in access_log
  95. access_log off;
  96.  
  97. # Allow access from 127.0.0.1
  98. allow 127.0.0.1;
  99.  
  100. # Deny all the other connections
  101. deny all;
  102. }
  103.  
  104. location ^~ /.well-known/acme-challenge {
  105. root /var/www/html/;
  106. index index.php index.html index.htm;
  107. location ~ ^/.well-known/acme-challenge/(.+\.php)$ {
  108. include /etc/nginx/webapps_settings.conf;
  109. }
  110. location ~* ^/.well-known/acme-challenge/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  111. root /var/www/html/;
  112. }
  113. }
  114. location ^~ /roundcube {
  115. root /var/www/html/;
  116. index index.php index.html index.htm;
  117. location ~ ^/roundcube/(.+\.php)$ {
  118. include /etc/nginx/webapps_settings.conf;
  119. }
  120. location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  121. root /var/www/html/;
  122. }
  123. }
  124. location ^~ /phpMyAdmin {
  125. root /var/www/html/;
  126. index index.php index.html index.htm;
  127. location ~ ^/phpMyAdmin/(.+\.php)$ {
  128. include /etc/nginx/webapps_settings.conf;
  129. }
  130. location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  131. root /var/www/html/;
  132. }
  133. }
  134. location ~ ^/phpmyadmin {
  135. rewrite ^/* /phpMyAdmin last;
  136. }
  137. location ~ ^/pma {
  138. rewrite ^/* /phpMyAdmin last;
  139. }
  140. location ~ /(\.htaccess|\.htpasswd|\.user\.ini|\.env|\.git) {
  141. deny all;
  142. }
  143.  
  144. location ~ /roundcube/(bin|SQL|config|logs|temp)/ {
  145. deny all;
  146. }
  147. location ~ /phpMyAdmin/log/ {
  148. deny all;
  149. }
  150. }
  151.  
  152. # HTTPS server
  153. #
  154. server {
  155. listen 172.72.133.10:443 ssl;
  156. listen 127.0.0.1:443 ssl;
  157. #listen [::1]:443 ssl;
  158.  
  159. server_name $hostname 172.72.133.10;
  160.  
  161. ssl_certificate /etc/nginx/ssl.crt/server.crt.combined;
  162. ssl_certificate_key /etc/nginx/ssl.key/server.key;
  163.  
  164. root /var/www/html;
  165.  
  166. #Support UserDir (~/user/)
  167. location ~^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
  168. alias /home/$userdir_user/public_html$userdir_uri;
  169. autoindex on;
  170.  
  171. location ~ \.php$ {
  172. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  173. include /etc/nginx/fastcgi_params;
  174. fastcgi_index index.php;
  175.  
  176. #try_files does not work after alias directive
  177. if (!-f $request_filename) {
  178. return 404;
  179. }
  180.  
  181. fastcgi_param DOCUMENT_ROOT /home/$userdir_user/public_html;
  182. fastcgi_param SCRIPT_FILENAME $request_filename;
  183. fastcgi_pass unix:/usr/local/php73/sockets/$userdir_user.sock;
  184. }
  185. }
  186.  
  187. # Pass all .php files onto a php-fpm/php-fcgi server.
  188. location ~ \.php$ {
  189. try_files $uri =404;
  190.  
  191. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  192. include /etc/nginx/fastcgi_params;
  193. fastcgi_index index.php;
  194. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  195. fastcgi_pass unix:/usr/local/php73/sockets/webapps.sock;
  196. }
  197.  
  198. location /nginx_status {
  199. # Enable nginx status page
  200. stub_status on;
  201.  
  202. # Disable status page logging in access_log
  203. access_log off;
  204.  
  205. # Allow access from 127.0.0.1
  206. allow 127.0.0.1;
  207.  
  208. # Deny all the other connections
  209. deny all;
  210. }
  211.  
  212. location ^~ /.well-known/acme-challenge {
  213. root /var/www/html/;
  214. index index.php index.html index.htm;
  215. location ~ ^/.well-known/acme-challenge/(.+\.php)$ {
  216. include /etc/nginx/webapps_settings.conf;
  217. }
  218. location ~* ^/.well-known/acme-challenge/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  219. root /var/www/html/;
  220. }
  221. }
  222. location ^~ /roundcube {
  223. root /var/www/html/;
  224. index index.php index.html index.htm;
  225. location ~ ^/roundcube/(.+\.php)$ {
  226. include /etc/nginx/webapps_settings.conf;
  227. }
  228. location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  229. root /var/www/html/;
  230. }
  231. }
  232. location ^~ /phpMyAdmin {
  233. root /var/www/html/;
  234. index index.php index.html index.htm;
  235. location ~ ^/phpMyAdmin/(.+\.php)$ {
  236. include /etc/nginx/webapps_settings.conf;
  237. }
  238. location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  239. root /var/www/html/;
  240. }
  241. }
  242. location ~ ^/phpmyadmin {
  243. rewrite ^/* /phpMyAdmin last;
  244. }
  245. location ~ ^/pma {
  246. rewrite ^/* /phpMyAdmin last;
  247. }
  248. location ~ /(\.htaccess|\.htpasswd|\.user\.ini|\.env|\.git) {
  249. deny all;
  250. }
  251. location ~ /roundcube/(bin|SQL|config|logs|temp)/ {
  252. deny all;
  253. }
  254. location ~ /phpMyAdmin/log/ {
  255. deny all;
  256. }
  257. }
  258.  
  259. server
  260. {
  261. listen 172.72.133.10:80;
  262. server_name buro247.my www.buro247.my ;
  263. access_log /var/log/nginx/domains/buro247.my.log;
  264. access_log /var/log/nginx/domains/buro247.my.bytes bytes;
  265. error_log /var/log/nginx/domains/buro247.my.error.log;
  266. root /home/buromy/domains/buro247.my/public_html;
  267. index index.php index.html index.htm;
  268. # use fastcgi for all php files
  269. location ~ \.php$
  270. {
  271. try_files $uri =404;
  272. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  273. include /etc/nginx/fastcgi_params;
  274. fastcgi_index index.php;
  275. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  276. include /etc/nginx/nginx_limits.conf;
  277. if (-f $request_filename)
  278. {
  279. fastcgi_pass unix:/usr/local/php73/sockets/buromy.sock;
  280. }
  281. }
  282. location ^~ /.well-known/acme-challenge {
  283. root /var/www/html/;
  284. index index.php index.html index.htm;
  285. location ~ ^/.well-known/acme-challenge/(.+\.php)$ {
  286. include /etc/nginx/webapps_settings.conf;
  287. }
  288. location ~* ^/.well-known/acme-challenge/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  289. root /var/www/html/;
  290. }
  291. }
  292. location ^~ /roundcube {
  293. root /var/www/html/;
  294. index index.php index.html index.htm;
  295. location ~ ^/roundcube/(.+\.php)$ {
  296. include /etc/nginx/webapps_settings.conf;
  297. }
  298. location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  299. root /var/www/html/;
  300. }
  301. }
  302. location ^~ /phpMyAdmin {
  303. root /var/www/html/;
  304. index index.php index.html index.htm;
  305. location ~ ^/phpMyAdmin/(.+\.php)$ {
  306. include /etc/nginx/webapps_settings.conf;
  307. }
  308. location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  309. root /var/www/html/;
  310. }
  311. }
  312. location ~ ^/phpmyadmin {
  313. rewrite ^/* /phpMyAdmin last;
  314. }
  315. location ~ ^/pma {
  316. rewrite ^/* /phpMyAdmin last;
  317. }
  318. location ~ /(\.htaccess|\.htpasswd|\.user\.ini|\.env|\.git) {
  319. deny all;
  320. }
  321.  
  322. location ~ /roundcube/(bin|SQL|config|logs|temp)/ {
  323. deny all;
  324. }
  325. location ~ /phpMyAdmin/log/ {
  326. deny all;
  327. }
  328. }
  329.  
  330. server
  331. {
  332. listen 172.72.133.10:443 ssl http2;
  333. server_name buro247.my www.buro247.my ;
  334. access_log /var/log/nginx/domains/buro247.my.log;
  335. access_log /var/log/nginx/domains/buro247.my.bytes bytes;
  336. error_log /var/log/nginx/domains/buro247.my.error.log;
  337. root /home/buromy/domains/buro247.my/private_html;
  338. index index.php index.html index.htm;
  339. ssl_certificate /etc/nginx/ssl.crt/server.crt.combined;
  340. ssl_certificate_key /etc/nginx/ssl.key/server.key;
  341.  
  342. # use fastcgi for all php files
  343. location ~ \.php$
  344. {
  345. try_files $uri =404;
  346. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  347. include /etc/nginx/fastcgi_params;
  348. fastcgi_index index.php;
  349. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  350. include /etc/nginx/nginx_limits.conf;
  351. if (-f $request_filename)
  352. {
  353. fastcgi_pass unix:/usr/local/php73/sockets/buromy.sock;
  354. }
  355. }
  356. location ^~ /.well-known/acme-challenge {
  357. root /var/www/html/;
  358. index index.php index.html index.htm;
  359. location ~ ^/.well-known/acme-challenge/(.+\.php)$ {
  360. include /etc/nginx/webapps_settings.conf;
  361. }
  362. location ~* ^/.well-known/acme-challenge/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  363. root /var/www/html/;
  364. }
  365. }
  366. location ^~ /roundcube {
  367. root /var/www/html/;
  368. index index.php index.html index.htm;
  369. location ~ ^/roundcube/(.+\.php)$ {
  370. include /etc/nginx/webapps_settings.conf;
  371. }
  372. location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  373. root /var/www/html/;
  374. }
  375. }
  376. location ^~ /phpMyAdmin {
  377. root /var/www/html/;
  378. index index.php index.html index.htm;
  379. location ~ ^/phpMyAdmin/(.+\.php)$ {
  380. include /etc/nginx/webapps_settings.conf;
  381. }
  382. location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|webp|xml|txt))$ {
  383. root /var/www/html/;
  384. }
  385. }
  386. location ~ ^/phpmyadmin {
  387. rewrite ^/* /phpMyAdmin last;
  388. }
  389. location ~ ^/pma {
  390. rewrite ^/* /phpMyAdmin last;
  391. }
  392. location ~ /(\.htaccess|\.htpasswd|\.user\.ini|\.env|\.git) {
  393. deny all;
  394. }
  395. location ~ /roundcube/(bin|SQL|config|logs|temp)/ {
  396. deny all;
  397. }
  398. location ~ /phpMyAdmin/log/ {
  399. deny all;
  400. }
  401. }
  402.  
  403. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement