ソースを参照

:gear: laps staging changes

laps-staging
toj 4年前
コミット
b258c5d2d4
4個のファイルの変更59行の追加57行の削除
  1. 2
    2
      docker-compose.yml
  2. 3
    2
      nginx/Dockerfile
  3. 46
    45
      nginx/configs/default.conf
  4. 8
    8
      nginx/configs/nginx.conf

+ 2
- 2
docker-compose.yml ファイルの表示

@@ -8,8 +8,8 @@ services:
8 8
         image: proxy-nginx
9 9
         container_name: reverse-proxy
10 10
         ports:
11
-            - "80:80"
12
-            - "443:443"
11
+            - 80:80
12
+            - 443:443
13 13
         restart: always
14 14
         networks:
15 15
             - staging_network

+ 3
- 2
nginx/Dockerfile ファイルの表示

@@ -1,7 +1,7 @@
1 1
 FROM nginx
2 2
 
3 3
 ### Copy files from the temp build
4
-# COPY ./nginx/temp/index.html /opt/<path-to-project>/index.html
4
+COPY ./nginx/temp/index.html /usr/share/nginx/index.html
5 5
 
6 6
 ### Setup SSL
7 7
 # RUN mkdir -p /etc/ssl/private && chmod 700 /etc/ssl/private
@@ -12,10 +12,11 @@ FROM nginx
12 12
 # COPY ./nginx/keys/letsencrypt.crt /etc/ssl/certs/letsencrypt.crt
13 13
 
14 14
 ### Configure Nginx to Use SSL
15
-RUN mkdir -p /etc/nginx/snippets
15
+# RUN mkdir -p /etc/nginx/snippets
16 16
 # COPY ./nginx/configs/letsencrypt.conf /etc/nginx/snippets/letsencrypt.conf
17 17
 # COPY ./nginx/configs/ssl-params.conf /etc/nginx/snippets/ssl-params.conf
18 18
 
19 19
 ### Move over the nginx.conf and default.config server configs
20 20
 COPY ./nginx/configs/default.conf /etc/nginx/conf.d/default.conf
21 21
 COPY ./nginx/configs/nginx.conf /etc/nginx/nginx.conf
22
+

+ 46
- 45
nginx/configs/default.conf ファイルの表示

@@ -1,63 +1,64 @@
1 1
 # Upstream sites for proxy-ing
2
-upstream wp {
3
-     server <YOUR_SERVER_IP_ADDRESS>:8082;
2
+upstream js {
3
+        server js-wp;
4
+}
5
+upstream laps {
6
+        server laps-wp;
4 7
 }
5 8
 
6
-### Redirect regular traffic to SSL
7 9
 server {
8
-    listen 80 default_server;
9
-    listen [::]:80 default_server;
10
+	listen		80;
11
+	listen		[::]:80;
12
+	server_name	jeffreysmithillustrator.com www.jeffreysmithillustrator.com;
13
+	
14
+	location / {
15
+		#blocks blank user_agents
16
+                if ($http_user_agent = "") { return  301 $scheme://www.google.com/; }
10 17
 
11
-    server_name <CHANGE_ME> www.<CHANGE_ME>;
18
+	        proxy_set_header    Host                 $server_name;
19
+	        proxy_set_header    X-Real-IP            $remote_addr;
20
+	        proxy_set_header    X-Forwarded-For      $proxy_add_x_forwarded_for;
21
+		proxy_set_header    X-Forwarded-Proto    $scheme;
12 22
 
13
-    # return 301 https://$host$request_uri;
23
+		proxy_pass          http://js;
24
+		proxy_redirect      off;
14 25
 
15
-    # root /opt/app/public/;
16
-    # WP Test
17
-    root /var/www/html;
18
-    index index.html index.htm index.php index.nginx-debian.html;
26
+		proxy_connect_timeout   300;
27
+                proxy_send_timeout      300;
28
+                proxy_read_timeout      300;
29
+	}
19 30
 
20
-    location / {
21
-        proxy_set_header    Host                 $host;
22
-        proxy_set_header    X-Real-IP            $remote_addr;
23
-        proxy_set_header    X-Forwarded-For      $proxy_add_x_forwarded_for;
24
-        proxy_set_header    X-Forwarded-Proto    $scheme;
31
+        location ~/\.ht {
32
+                deny all;
33
+        }
25 34
 
26
-        proxy_pass          http://wp;
27
-        proxy_redirect      off;
28
-    }
29 35
 }
30 36
 
31
-### SSL Stuff
32 37
 server {
33
-    listen 443 ssl http2;
34
-    listen [::]:443 ssl http2;
35
-
36
-    server_name <CHANGE_ME> www.<CHANGE_ME>;
38
+	listen		80;
39
+	listen		[::]:80;
40
+	server_name	staging.laprintmaking.com;
41
+	
42
+	location / {
43
+		#blocks blank user_agents
44
+                if ($http_user_agent = "") { return  301 $scheme://www.google.com/; }
37 45
 
38
-    include snippets/letsencrypt.conf;
39
-    include snippets/ssl-params.conf;
46
+	        proxy_set_header    Host                 $server_name;
47
+	        proxy_set_header    X-Real-IP            $remote_addr;
48
+	        proxy_set_header    X-Forwarded-For      $proxy_add_x_forwarded_for;
49
+		proxy_set_header    X-Forwarded-Proto    $scheme;
40 50
 
41
-    root /var/www/html;
42
-    index index.html index.htm index.php index.nginx-debian.html;
51
+		proxy_pass          http://laps;
52
+		proxy_redirect      off;
43 53
 
44
-    # location / {
45
-    #    try_files $uri $uri/ /index.php;
46
-    # }
54
+		proxy_connect_timeout   300;
55
+                proxy_send_timeout      300;
56
+                proxy_read_timeout      300;
57
+	}
47 58
 
48
-    location / {
49
-        proxy_set_header        Host              $host;
50
-        proxy_set_header        X-Real-IP         $remote_addr;
51
-        proxy_set_header        X-Forwarded-For   $proxy_add_x_forwarded_for;
52
-        proxy_set_header        X-Forwarded-Proto $scheme;
53
-        proxy_set_header        Accept-Encoding   "";
54
-        proxy_set_header        Proxy             "";
59
+        location ~/\.ht {
60
+                deny all;
61
+        }
55 62
 
56
-        proxy_pass          http://wp;
57
-        proxy_redirect      off;
58
-    }
63
+}
59 64
 
60
-    location ~/\.ht {
61
-        deny all;
62
-    }
63
-}

+ 8
- 8
nginx/configs/nginx.conf ファイルの表示

@@ -25,16 +25,16 @@ http {
25 25
 
26 26
     keepalive_timeout  65;
27 27
 
28
-	gzip  on;
29
-    gzip_vary on;
30
-    gzip_min_length 10240;
31
-    gzip_proxied expired no-cache no-store private auth;
32
-    gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
33
-    gzip_disable "MSIE [1-6]\.";
28
+    #gzip  on;
29
+    #gzip_vary on;
30
+    #gzip_min_length 10240;
31
+    #gzip_proxied expired no-cache no-store private auth;
32
+    #gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
33
+    #gzip_disable "MSIE [1-6]\.";
34 34
 
35 35
     # Enable ngx_http_gzip_static_module for serving compressed files when possible.
36
-    gzip_static on;
36
+    #gzip_static on;
37 37
 
38 38
     # Bring over default server config
39 39
     include /etc/nginx/conf.d/default.conf;
40
-}
40
+}

読み込み中…
キャンセル
保存