Guest User

Name Server Nginx Conflict

a guest
Apr 28th, 2019
1,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.97 KB | None | 0 0
  1. eza@renova:~$ sudo nginx -T
  2. [sudo] password for eza:
  3. Sorry, try again.
  4. [sudo] password for eza:
  5. nginx: [warn] conflicting server name "example1.com" on 0.0.0.0:80, ignored
  6. nginx: [warn] conflicting server name "www.example1.com" on 0.0.0.0:80, ignored
  7. nginx: [warn] conflicting server name "example1.com" on [::]:80, ignored
  8. nginx: [warn] conflicting server name "www.example1.com" on [::]:80, ignored
  9. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  10. nginx: configuration file /etc/nginx/nginx.conf test is successful
  11. # configuration file /etc/nginx/nginx.conf:
  12. user www-data;
  13. worker_processes auto;
  14. pid /run/nginx.pid;
  15.  
  16. events {
  17. worker_connections 768;
  18. # multi_accept on;
  19. }
  20.  
  21. http {
  22.  
  23. ##
  24. # Basic Settings
  25. ##
  26.  
  27. sendfile on;
  28. tcp_nopush on;
  29. tcp_nodelay on;
  30. keepalive_timeout 65;
  31. types_hash_max_size 2048;
  32. # server_tokens off;
  33.  
  34. server_names_hash_bucket_size 64;
  35. # server_name_in_redirect off;
  36.  
  37. include /etc/nginx/mime.types;
  38. default_type application/octet-stream;
  39.  
  40. ##
  41. # SSL Settings
  42. ##
  43.  
  44. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  45. ssl_prefer_server_ciphers on;
  46.  
  47. ##
  48. # Logging Settings
  49. ##
  50.  
  51. access_log /var/log/nginx/access.log;
  52. error_log /var/log/nginx/error.log;
  53.  
  54. ##
  55. # Gzip Settings
  56. ##
  57.  
  58. gzip on;
  59. gzip_disable "msie6";
  60.  
  61. # gzip_vary on;
  62. # gzip_proxied any;
  63. # gzip_comp_level 6;
  64. # gzip_buffers 16 8k;
  65. # gzip_http_version 1.1;
  66. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  67.  
  68. ##
  69. # Virtual Host Configs
  70. ##
  71.  
  72. include /etc/nginx/conf.d/*.conf;
  73. include /etc/nginx/sites-enabled/*;
  74. }
  75.  
  76.  
  77. #mail {
  78. # # See sample authentication script at:
  79. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  80. #
  81. # # auth_http localhost/auth.php;
  82. # # pop3_capabilities "TOP" "USER";
  83. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  84. #
  85. # server {
  86. # listen localhost:110;
  87. # protocol pop3;
  88. # proxy on;
  89. # }
  90. #
  91. # server {
  92. # listen localhost:143;
  93. # protocol imap;
  94. # proxy on;
  95. # }
  96. #}
  97.  
  98. # configuration file /etc/nginx/mime.types:
  99.  
  100. types {
  101. text/html html htm shtml;
  102. text/css css;
  103. text/xml xml;
  104. image/gif gif;
  105. image/jpeg jpeg jpg;
  106. application/javascript js;
  107. application/atom+xml atom;
  108. application/rss+xml rss;
  109.  
  110. text/mathml mml;
  111. text/plain txt;
  112. text/vnd.sun.j2me.app-descriptor jad;
  113. text/vnd.wap.wml wml;
  114. text/x-component htc;
  115.  
  116. image/png png;
  117. image/tiff tif tiff;
  118. image/vnd.wap.wbmp wbmp;
  119. image/x-icon ico;
  120. image/x-jng jng;
  121. image/x-ms-bmp bmp;
  122. image/svg+xml svg svgz;
  123. image/webp webp;
  124.  
  125. application/font-woff woff;
  126. application/java-archive jar war ear;
  127. application/json json;
  128. application/mac-binhex40 hqx;
  129. application/msword doc;
  130. application/pdf pdf;
  131. application/postscript ps eps ai;
  132. application/rtf rtf;
  133. application/vnd.apple.mpegurl m3u8;
  134. application/vnd.ms-excel xls;
  135. application/vnd.ms-fontobject eot;
  136. application/vnd.ms-powerpoint ppt;
  137. application/vnd.wap.wmlc wmlc;
  138. application/vnd.google-earth.kml+xml kml;
  139. application/vnd.google-earth.kmz kmz;
  140. application/x-7z-compressed 7z;
  141. application/x-cocoa cco;
  142. application/x-java-archive-diff jardiff;
  143. application/x-java-jnlp-file jnlp;
  144. application/x-makeself run;
  145. application/x-perl pl pm;
  146. application/x-pilot prc pdb;
  147. application/x-rar-compressed rar;
  148. application/x-redhat-package-manager rpm;
  149. application/x-sea sea;
  150. application/x-shockwave-flash swf;
  151. application/x-stuffit sit;
  152. application/x-tcl tcl tk;
  153. application/x-x509-ca-cert der pem crt;
  154. application/x-xpinstall xpi;
  155. application/xhtml+xml xhtml;
  156. application/xspf+xml xspf;
  157. application/zip zip;
  158.  
  159. application/octet-stream bin exe dll;
  160. application/octet-stream deb;
  161. application/octet-stream dmg;
  162. application/octet-stream iso img;
  163. application/octet-stream msi msp msm;
  164.  
  165. application/vnd.openxmlformats-officedocument.wordprocessingml.document d ocx;
  166. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet x lsx;
  167. application/vnd.openxmlformats-officedocument.presentationml.presentation p ptx;
  168.  
  169. audio/midi mid midi kar;
  170. audio/mpeg mp3;
  171. audio/ogg ogg;
  172. audio/x-m4a m4a;
  173. audio/x-realaudio ra;
  174.  
  175. video/3gpp 3gpp 3gp;
  176. video/mp2t ts;
  177. video/mp4 mp4;
  178. video/mpeg mpeg mpg;
  179. video/quicktime mov;
  180. video/webm webm;
  181. video/x-flv flv;
  182. video/x-m4v m4v;
  183. video/x-mng mng;
  184. video/x-ms-asf asx asf;
  185. video/x-ms-wmv wmv;
  186. video/x-msvideo avi;
  187. }
  188.  
  189. # configuration file /etc/nginx/sites-enabled/default:
  190. ##
  191. # You should look at the following URL's in order to grasp a solid understanding
  192. # of Nginx configuration files in order to fully unleash the power of Nginx.
  193. # http://wiki.nginx.org/Pitfalls
  194. # http://wiki.nginx.org/QuickStart
  195. # http://wiki.nginx.org/Configuration
  196. #
  197. # Generally, you will want to move this file somewhere, and start with a clean
  198. # file but keep this around for reference. Or just disable in sites-enabled.
  199. #
  200. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  201. ##
  202.  
  203. # Default server configuration
  204. #
  205.  
  206. server {
  207. listen 80 default_server;
  208. listen [::]:80 default_server;
  209.  
  210. root /var/www/html;
  211. index index.php index.html index.htm index.nginx-debian.html;
  212.  
  213. server_name _;
  214.  
  215. location / {
  216. #try_files $uri $uri/ =404;
  217. try_files $uri $uri/ /index.php$is_args$args;
  218. }
  219.  
  220. location = /favicon.ico { log_not_found off; access_log off; }
  221. location = /robots.txt { log_not_found off; access_log off; allow all; }
  222. location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
  223. expires max;
  224. log_not_found off;
  225. }
  226.  
  227. location ~ \.php$ {
  228. include snippets/fastcgi-php.conf;
  229. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  230. }
  231.  
  232. location ~ /\.ht {
  233. deny all;
  234. }
  235. }
  236.  
  237. # Virtual Host configuration for example.com
  238. #
  239. # You can move that to a different file under sites-available/ and symlink that
  240. # to sites-enabled/ to enable it.
  241. #
  242. #server {
  243. # listen 80;
  244. # listen [::]:80;
  245. #
  246. # server_name example.com;
  247. #
  248. # root /var/www/example.com;
  249. # index index.html;
  250. #
  251. # location / {
  252. # try_files $uri $uri/ =404;
  253. # }
  254. #}
  255.  
  256. # configuration file /etc/nginx/snippets/fastcgi-php.conf:
  257. # regex to split $uri to $fastcgi_script_name and $fastcgi_path
  258. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  259.  
  260. # Check that the PHP script exists before passing it
  261. try_files $fastcgi_script_name =404;
  262.  
  263. # Bypass the fact that try_files resets $fastcgi_path_info
  264. # see: http://trac.nginx.org/nginx/ticket/321
  265. set $path_info $fastcgi_path_info;
  266. fastcgi_param PATH_INFO $path_info;
  267.  
  268. fastcgi_index index.php;
  269. include fastcgi.conf;
  270.  
  271. # configuration file /etc/nginx/fastcgi.conf:
  272.  
  273. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  274. fastcgi_param QUERY_STRING $query_string;
  275. fastcgi_param REQUEST_METHOD $request_method;
  276. fastcgi_param CONTENT_TYPE $content_type;
  277. fastcgi_param CONTENT_LENGTH $content_length;
  278.  
  279. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  280. fastcgi_param REQUEST_URI $request_uri;
  281. fastcgi_param DOCUMENT_URI $document_uri;
  282. fastcgi_param DOCUMENT_ROOT $document_root;
  283. fastcgi_param SERVER_PROTOCOL $server_protocol;
  284. fastcgi_param REQUEST_SCHEME $scheme;
  285. fastcgi_param HTTPS $https if_not_empty;
  286.  
  287. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  288. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  289.  
  290. fastcgi_param REMOTE_ADDR $remote_addr;
  291. fastcgi_param REMOTE_PORT $remote_port;
  292. fastcgi_param SERVER_ADDR $server_addr;
  293. fastcgi_param SERVER_PORT $server_port;
  294. fastcgi_param SERVER_NAME $server_name;
  295.  
  296. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  297. fastcgi_param REDIRECT_STATUS 200;
  298.  
  299. # configuration file /etc/nginx/sites-enabled/example1.com:
  300. ##
  301. # You should look at the following URL's in order to grasp a solid understanding
  302. # of Nginx configuration files in order to fully unleash the power of Nginx.
  303. # http://wiki.nginx.org/Pitfalls
  304. # http://wiki.nginx.org/QuickStart
  305. # http://wiki.nginx.org/Configuration
  306. #
  307. # Generally, you will want to move this file somewhere, and start with a clean
  308. # file but keep this around for reference. Or just disable in sites-enabled.
  309. #
  310. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  311. ##
  312.  
  313. # Default server configuration
  314. #
  315. server {
  316. listen 80;
  317. listen [::]:80;
  318.  
  319. root /var/www/example1.com/html;
  320. index index.php index.html index.htm index.nginx-debian.html;
  321.  
  322. server_name example1.com www.example1.com;
  323.  
  324. location / {
  325. #try_files $uri $uri/ =404;
  326. try_files $uri $uri/ /index.php$is_args$args;
  327.  
  328. }
  329.  
  330. location = /favicon.ico { log_not_found off; access_log off; }
  331. location = /robots.txt { log_not_found off; access_log off; allow all; }
  332. location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
  333. expires max;
  334. log_not_found off;
  335. }
  336.  
  337. location ~ \.php$ {
  338. include snippets/fastcgi-php.conf;
  339. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  340. }
  341.  
  342. location ~ /\.ht {
  343. deny all;
  344. }
  345.  
  346. listen [::]:443 ssl ipv6only=on; # managed by Certbot
  347. listen 443 ssl; # managed by Certbot
  348. ssl_certificate /etc/letsencrypt/live/example1.com/fullchain.pem; # managed by Certbot
  349. ssl_certificate_key /etc/letsencrypt/live/example1.com/privkey.pem; # manage d by Certbot
  350. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  351. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  352.  
  353.  
  354. }
  355.  
  356.  
  357. # Virtual Host configuration for example.com
  358. #
  359. # You can move that to a different file under sites-available/ and symlink that
  360. # to sites-enabled/ to enable it.
  361. #
  362. #server {
  363. # listen 80;
  364. # listen [::]:80;
  365. #
  366. # server_name example.com;
  367. #
  368. # root /var/www/example.com;
  369. # index index.html;
  370. #
  371. # location / {
  372. # try_files $uri $uri/ =404;
  373. # }
  374. #}
  375.  
  376. server {
  377. if ($host = www.example1.com) {
  378. return 301 https://$host$request_uri;
  379. } # managed by Certbot
  380.  
  381.  
  382. if ($host = example1.com) {
  383. return 301 https://$host$request_uri;
  384. } # managed by Certbot
  385.  
  386.  
  387. listen 80;
  388. listen [::]:80;
  389.  
  390. server_name example1.com www.example1.com;
  391. return 404; # managed by Certbot
  392.  
  393.  
  394.  
  395.  
  396. }
  397.  
  398. # configuration file /etc/nginx/snippets/fastcgi-php.conf:
  399. # regex to split $uri to $fastcgi_script_name and $fastcgi_path
  400. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  401.  
  402. # Check that the PHP script exists before passing it
  403. try_files $fastcgi_script_name =404;
  404.  
  405. # Bypass the fact that try_files resets $fastcgi_path_info
  406. # see: http://trac.nginx.org/nginx/ticket/321
  407. set $path_info $fastcgi_path_info;
  408. fastcgi_param PATH_INFO $path_info;
  409.  
  410. fastcgi_index index.php;
  411. include fastcgi.conf;
  412.  
  413. # configuration file /etc/nginx/fastcgi.conf:
  414.  
  415. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  416. fastcgi_param QUERY_STRING $query_string;
  417. fastcgi_param REQUEST_METHOD $request_method;
  418. fastcgi_param CONTENT_TYPE $content_type;
  419. fastcgi_param CONTENT_LENGTH $content_length;
  420.  
  421. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  422. fastcgi_param REQUEST_URI $request_uri;
  423. fastcgi_param DOCUMENT_URI $document_uri;
  424. fastcgi_param DOCUMENT_ROOT $document_root;
  425. fastcgi_param SERVER_PROTOCOL $server_protocol;
  426. fastcgi_param REQUEST_SCHEME $scheme;
  427. fastcgi_param HTTPS $https if_not_empty;
  428.  
  429. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  430. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  431.  
  432. fastcgi_param REMOTE_ADDR $remote_addr;
  433. fastcgi_param REMOTE_PORT $remote_port;
  434. fastcgi_param SERVER_ADDR $server_addr;
  435. fastcgi_param SERVER_PORT $server_port;
  436. fastcgi_param SERVER_NAME $server_name;
  437.  
  438. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  439. fastcgi_param REDIRECT_STATUS 200;
  440.  
  441. # configuration file /etc/letsencrypt/options-ssl-nginx.conf:
  442. # This file contains important security parameters. If you modify this file
  443. # manually, Certbot will be unable to automatically provide future security
  444. # updates. Instead, Certbot will print and log an error message with a path to
  445. # the up-to-date file that you will need to refer to when manually updating
  446. # this file.
  447.  
  448. ssl_session_cache shared:le_nginx_SSL:1m;
  449. ssl_session_timeout 1440m;
  450.  
  451. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  452. ssl_prefer_server_ciphers on;
  453.  
  454. ssl_ciphers "Delete"
  455.  
  456. # configuration file /etc/nginx/sites-enabled/example2.com:
  457. ##
  458. # You should look at the following URL's in order to grasp a solid understanding
  459. # of Nginx configuration files in order to fully unleash the power of Nginx.
  460. # http://wiki.nginx.org/Pitfalls
  461. # http://wiki.nginx.org/QuickStart
  462. # http://wiki.nginx.org/Configuration
  463. #
  464. # Generally, you will want to move this file somewhere, and start with a clean
  465. # file but keep this around for reference. Or just disable in sites-enabled.
  466. #
  467. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  468. ##
  469.  
  470. # Default server configuration
  471. #
  472. server {
  473. listen 80;
  474. listen [::]:80;
  475.  
  476. root /var/www/example2.com/html;
  477. index index.html index.htm index.nginx-debian.html;
  478.  
  479. server_name example2.com www.example2.com;
  480.  
  481. location / {
  482. try_files $uri $uri/ =404;
  483. }
  484.  
  485. location ~ \.php$ {
  486. include snippets/fastcgi-php.conf;
  487. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  488. }
  489.  
  490. location ~ /\.ht {
  491. deny all;
  492. }
  493. }
  494.  
  495.  
  496. # Virtual Host configuration for example.com
  497. #
  498. # You can move that to a different file under sites-available/ and symlink that
  499. # to sites-enabled/ to enable it.
  500. #
  501. #server {
  502. # listen 80;
  503. # listen [::]:80;
  504. #
  505. # server_name example.com;
  506. #
  507. # root /var/www/example.com;
  508. # index index.html;
  509. #
  510. # location / {
  511. # try_files $uri $uri/ =404;
  512. # }
  513. #}
  514.  
  515. # configuration file /etc/nginx/snippets/fastcgi-php.conf:
  516. # regex to split $uri to $fastcgi_script_name and $fastcgi_path
  517. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  518.  
  519. # Check that the PHP script exists before passing it
  520. try_files $fastcgi_script_name =404;
  521.  
  522. # Bypass the fact that try_files resets $fastcgi_path_info
  523. # see: http://trac.nginx.org/nginx/ticket/321
  524. set $path_info $fastcgi_path_info;
  525. fastcgi_param PATH_INFO $path_info;
  526.  
  527. fastcgi_index index.php;
  528. include fastcgi.conf;
  529.  
  530. # configuration file /etc/nginx/fastcgi.conf:
  531.  
  532. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  533. fastcgi_param QUERY_STRING $query_string;
  534. fastcgi_param REQUEST_METHOD $request_method;
  535. fastcgi_param CONTENT_TYPE $content_type;
  536. fastcgi_param CONTENT_LENGTH $content_length;
  537.  
  538. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  539. fastcgi_param REQUEST_URI $request_uri;
  540. fastcgi_param DOCUMENT_URI $document_uri;
  541. fastcgi_param DOCUMENT_ROOT $document_root;
  542. fastcgi_param SERVER_PROTOCOL $server_protocol;
  543. fastcgi_param REQUEST_SCHEME $scheme;
  544. fastcgi_param HTTPS $https if_not_empty;
  545.  
  546. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  547. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  548.  
  549. fastcgi_param REMOTE_ADDR $remote_addr;
  550. fastcgi_param REMOTE_PORT $remote_port;
  551. fastcgi_param SERVER_ADDR $server_addr;
  552. fastcgi_param SERVER_PORT $server_port;
  553. fastcgi_param SERVER_NAME $server_name;
  554.  
  555. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  556. fastcgi_param REDIRECT_STATUS 200;
Advertisement
Add Comment
Please, Sign In to add comment