Gufovskiy

Untitled

Aug 28th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.29 KB | None | 0 0
  1. sudo nginx -T && nginx -t && nginx -v
  2.  
  3. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  4. nginx: configuration file /etc/nginx/nginx.conf test is successful
  5. # configuration file /etc/nginx/nginx.conf:
  6. user www-data;
  7. worker_processes auto;
  8. pid /run/nginx.pid;
  9. include /etc/nginx/modules-enabled/*.conf;
  10.  
  11. events {
  12. worker_connections 768;
  13. # multi_accept on;
  14. }
  15.  
  16. http {
  17.  
  18. ##
  19. # Basic Settings
  20. ##
  21.  
  22. sendfile on;
  23. tcp_nopush on;
  24. tcp_nodelay on;
  25. keepalive_timeout 65;
  26. types_hash_max_size 2048;
  27. # server_tokens off;
  28.  
  29. # server_names_hash_bucket_size 64;
  30. # server_name_in_redirect off;
  31.  
  32. include /etc/nginx/mime.types;
  33. default_type application/octet-stream;
  34.  
  35. ##
  36. # SSL Settings
  37. ##
  38.  
  39. ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
  40. ssl_prefer_server_ciphers on;
  41.  
  42. ##
  43. # Logging Settings
  44. ##
  45.  
  46. access_log /var/log/nginx/access.log;
  47. error_log /var/log/nginx/error.log;
  48.  
  49. ##
  50. # Gzip Settings
  51. ##
  52.  
  53. gzip on;
  54.  
  55. # gzip_vary on;
  56. # gzip_proxied any;
  57. # gzip_comp_level 6;
  58. # gzip_buffers 16 8k;
  59. # gzip_http_version 1.1;
  60. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  61.  
  62. ##
  63. # Virtual Host Configs
  64. ##
  65.  
  66. include /etc/nginx/conf.d/*.conf;
  67. include /etc/nginx/sites-enabled/*;
  68. }
  69.  
  70.  
  71. #mail {
  72. # # See sample authentication script at:
  73. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  74. #
  75. # # auth_http localhost/auth.php;
  76. # # pop3_capabilities "TOP" "USER";
  77. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  78. #
  79. # server {
  80. # listen localhost:110;
  81. # protocol pop3;
  82. # proxy on;
  83. # }
  84. #
  85. # server {
  86. # listen localhost:143;
  87. # protocol imap;
  88. # proxy on;
  89. # }
  90. #}
  91.  
  92. # configuration file /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:
  93. load_module modules/ngx_http_image_filter_module.so;
  94.  
  95. # configuration file /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf:
  96. load_module modules/ngx_http_xslt_filter_module.so;
  97.  
  98. # configuration file /etc/nginx/modules-enabled/50-mod-mail.conf:
  99. load_module modules/ngx_mail_module.so;
  100.  
  101. # configuration file /etc/nginx/modules-enabled/50-mod-stream.conf:
  102. load_module modules/ngx_stream_module.so;
  103.  
  104. # configuration file /etc/nginx/mime.types:
  105.  
  106. types {
  107. text/html html htm shtml;
  108. text/css css;
  109. text/xml xml;
  110. image/gif gif;
  111. image/jpeg jpeg jpg;
  112. application/javascript js;
  113. application/atom+xml atom;
  114. application/rss+xml rss;
  115.  
  116. text/mathml mml;
  117. text/plain txt;
  118. text/vnd.sun.j2me.app-descriptor jad;
  119. text/vnd.wap.wml wml;
  120. text/x-component htc;
  121.  
  122. image/png png;
  123. image/tiff tif tiff;
  124. image/vnd.wap.wbmp wbmp;
  125. image/x-icon ico;
  126. image/x-jng jng;
  127. image/x-ms-bmp bmp;
  128. image/svg+xml svg svgz;
  129. image/webp webp;
  130.  
  131. application/font-woff woff;
  132. application/java-archive jar war ear;
  133. application/json json;
  134. application/mac-binhex40 hqx;
  135. application/msword doc;
  136. application/pdf pdf;
  137. application/postscript ps eps ai;
  138. application/rtf rtf;
  139. application/vnd.apple.mpegurl m3u8;
  140. application/vnd.ms-excel xls;
  141. application/vnd.ms-fontobject eot;
  142. application/vnd.ms-powerpoint ppt;
  143. application/vnd.wap.wmlc wmlc;
  144. application/vnd.google-earth.kml+xml kml;
  145. application/vnd.google-earth.kmz kmz;
  146. application/x-7z-compressed 7z;
  147. application/x-cocoa cco;
  148. application/x-java-archive-diff jardiff;
  149. application/x-java-jnlp-file jnlp;
  150. application/x-makeself run;
  151. application/x-perl pl pm;
  152. application/x-pilot prc pdb;
  153. application/x-rar-compressed rar;
  154. application/x-redhat-package-manager rpm;
  155. application/x-sea sea;
  156. application/x-shockwave-flash swf;
  157. application/x-stuffit sit;
  158. application/x-tcl tcl tk;
  159. application/x-x509-ca-cert der pem crt;
  160. application/x-xpinstall xpi;
  161. application/xhtml+xml xhtml;
  162. application/xspf+xml xspf;
  163. application/zip zip;
  164.  
  165. application/octet-stream bin exe dll;
  166. application/octet-stream deb;
  167. application/octet-stream dmg;
  168. application/octet-stream iso img;
  169. application/octet-stream msi msp msm;
  170.  
  171. application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
  172. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
  173. application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
  174.  
  175. audio/midi mid midi kar;
  176. audio/mpeg mp3;
  177. audio/ogg ogg;
  178. audio/x-m4a m4a;
  179. audio/x-realaudio ra;
  180.  
  181. video/3gpp 3gpp 3gp;
  182. video/mp2t ts;
  183. video/mp4 mp4;
  184. video/mpeg mpeg mpg;
  185. video/quicktime mov;
  186. video/webm webm;
  187. video/x-flv flv;
  188. video/x-m4v m4v;
  189. video/x-mng mng;
  190. video/x-ms-asf asx asf;
  191. video/x-ms-wmv wmv;
  192. video/x-msvideo avi;
  193. }
  194.  
  195. # configuration file /etc/nginx/sites-enabled/default:
  196. ##
  197. # You should look at the following URL's in order to grasp a solid understanding
  198. # of Nginx configuration files in order to fully unleash the power of Nginx.
  199. # https://www.nginx.com/resources/wiki/start/
  200. # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
  201. # https://wiki.debian.org/Nginx/DirectoryStructure
  202. #
  203. # In most cases, administrators will remove this file from sites-enabled/ and
  204. # leave it as reference inside of sites-available where it will continue to be
  205. # updated by the nginx packaging team.
  206. #
  207. # This file will automatically load configuration files provided by other
  208. # applications, such as Drupal or Wordpress. These applications will be made
  209. # available underneath a path with that package name, such as /drupal8.
  210. #
  211. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  212. ##
  213.  
  214. # Default server configuration
  215. #
  216. # HTTPS Server
  217. server {
  218. listen 443 ssl;
  219. server_name rocketserver.domainname;
  220.  
  221. error_log /var/log/nginx/rocketchat_error.log;
  222.  
  223. ssl_certificate /etc/nginx/certificate.crt;
  224. ssl_certificate_key /etc/nginx/certificate.key;
  225. ssl_dhparam /etc/nginx/dhparams.pem;
  226. ssl_protocols TLSv1.2;
  227. 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: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';
  228. ssl_prefer_server_ciphers on;
  229. ssl_session_cache shared:SSL:20m;
  230. ssl_session_timeout 180m;
  231.  
  232. location / {
  233. proxy_pass http://rocketserver:3000/;
  234. proxy_http_version 1.1;
  235. proxy_set_header Upgrade $http_upgrade;
  236. proxy_set_header Connection "upgrade";
  237. proxy_set_header Host $http_host;
  238. proxy_set_header X-Real-IP $remote_addr;
  239. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  240. proxy_set_header X-Forwarded-Proto https;
  241. proxy_set_header X-Nginx-Proxy true;
  242. proxy_redirect off;
  243. }
  244. }
  245.  
  246.  
  247. # Virtual Host configuration for example.com
  248. #
  249. # You can move that to a different file under sites-available/ and symlink that
  250. # to sites-enabled/ to enable it.
  251. #
  252. #server {
  253. # listen 80;
  254. # listen [::]:80;
  255. #
  256. # server_name example.com;
  257. #
  258. # root /var/www/example.com;
  259. # index index.html;
  260. #
  261. # location / {
  262. # try_files $uri $uri/ =404;
  263. # }
  264. #}
  265.  
  266. nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
  267. 2020/08/28 12:13:12 [warn] 549007#549007: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
  268. 2020/08/28 12:13:12 [emerg] 549007#549007: cannot load certificate key "/etc/nginx/certificate.key": BIO_new_file() failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/nginx/certificate.key','r') error:2006D002:BIO routines:BIO_new_file:system lib)
  269. nginx: configuration file /etc/nginx/nginx.conf test failed
  270.  
Add Comment
Please, Sign In to add comment