Skip to content
This repository
Browse code

Example nginx configuration.

  • Loading branch information...
commit 5fdb8af717544ff6b5baeea164a783b4c473696b 1 parent 1bb4bf3
Красимир Беров authored

Showing 1 changed file with 85 additions and 0 deletions. Show diff stats Hide diff stats

  1. 85  conf/nginx-vhost-example.com
85  conf/nginx-vhost-example.com
... ...
@@ -0,0 +1,85 @@
  1
+#Example nginx configuration for MYDLjE.
  2
+#Add the something like the following to your /etc/hosts file
  3
+#127.0.0.2    example.com www.example.com cpanel.example.com mydlje.example.com
  4
+
  5
+upstream mydlje {
  6
+    server 127.0.0.1:8080;
  7
+}
  8
+
  9
+server {
  10
+  listen 81;
  11
+  server_name mydlje.example.com;
  12
+  root /home/krasi/opt/public_dev/MYDLjE;
  13
+  index index.xhtml;
  14
+  
  15
+  location ~ ^(/conf/|/log/|/perl/|/tmp/|/templates/) {
  16
+    deny all;
  17
+  }
  18
+  location /pub {
  19
+    autoindex off;  
  20
+    expires 86400;
  21
+  }
  22
+  location /index.xhtml {
  23
+  allow 127.0.0.1;
  24
+  #or allow 192.168.0.0/16;
  25
+  #just for installation
  26
+  #root /home/krasi/opt/public_dev/MYDLjE;
  27
+  }
  28
+  
  29
+  location / {
  30
+    proxy_read_timeout 300;
  31
+    proxy_pass http://mydlje ;
  32
+    proxy_set_header Host $http_host;
  33
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  34
+  }
  35
+}
  36
+###########################
  37
+upstream cpanel {
  38
+    server 127.0.0.1:8081;
  39
+}
  40
+
  41
+server {
  42
+  listen 81;
  43
+  server_name cpanel.example.com;
  44
+  root /home/krasi/opt/public_dev/MYDLjE;
  45
+  location ~ ^(/conf/|/log/|/perl/|/tmp/|/templates/) {
  46
+    deny all;
  47
+  }
  48
+  location /pub {
  49
+    autoindex off;
  50
+    expires 86400;
  51
+  }
  52
+
  53
+  location / {
  54
+    proxy_read_timeout 300;
  55
+    proxy_pass http://cpanel;
  56
+    proxy_set_header Host $http_host;
  57
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  58
+  }
  59
+
  60
+}
  61
+###################
  62
+upstream site {
  63
+    server 127.0.0.1:8082;
  64
+}
  65
+
  66
+server {
  67
+  listen 81;
  68
+  server_name example.com www.example.com www.example.org example.org;
  69
+  root /home/krasi/opt/public_dev/MYDLjE;
  70
+  index index.html index.htm;
  71
+  location ~ ^(/conf/|/log/|/perl/|/tmp/|/templates/) {
  72
+    deny all;
  73
+  }
  74
+  location /pub {
  75
+    autoindex off;
  76
+    expires 86400;
  77
+  }
  78
+
  79
+  location / {
  80
+    proxy_read_timeout 300;
  81
+    proxy_pass http://site;
  82
+    proxy_set_header Host $http_host;
  83
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  84
+  }
  85
+}

0 notes on commit 5fdb8af

Please sign in to comment.
Something went wrong with that request. Please try again.