forked from publicissapient-france/workshop-nginx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
www-nginx-4.aws.xebiatechevent.info.conf
67 lines (56 loc) · 2.06 KB
/
www-nginx-4.aws.xebiatechevent.info.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
upstream backend {
server xfr-cocktail-nginx-4.aws.xebiatechevent.info:8080;
server xfr-cocktail-nginx-4.aws.xebiatechevent.info:8180;
}
server {
listen 80;
server_name www-nginx-4.aws.xebiatechevent.info;
root /opt/xebiatechevent.info;
index index.html;
rewrite ^/cocktail/sex-on-the-beach$ /cocktail/480818541 last;
listen 443 default_server ssl;
ssl_certificate /etc/nginx/conf.d/xebiatechevent.crt;
ssl_certificate_key /etc/nginx/conf.d/xebiatechevent.key;
error_log /var/log/nginx/www-nginx-4.aws.xebiatechevent.info.error.log;
access_log /var/log/nginx/www-nginx-4.aws.xebiatechevent.info.access.log custom;
location /nginx-status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location / {
#proxy_pass http://xfr-cocktail-nginx-4.aws.xebiatechevent.info:8080/;
proxy_pass http://backend;
proxy_redirect off;
# Forwarded original Host
proxy_set_header Host $host;
# Forward original client IP
proxy_set_header X-Real-IP $remote_addr;
# Properly feed X-Forwarded-For header
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache xebiatechevent;
proxy_cache_valid 200 10m;
proxy_cache_use_stale http_500;
}
location ~ \.(gif|png|jpg|jpeg)$ {
# We consider they are stored in our root directory
root /opt/xebiatechevent.info;
# In case of file not found then go to fetch
error_page 404 = @fetch;
# Define the expiration to 31 December 2037 23:59:59 GMT Time can be defined if you want something else
expires max;
}
# Special location for internal use only
location @fetch {
# Client accessing this URI will get 404
internal;
proxy_pass http://xfr-cocktail-nginx-4.aws.xebiatechevent.info:8080;
# Activate proxy store mirror on demand real feature
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path /tmp;
# Files stored will be persisted here to match exact uri path starting root as /
root /opt/xebiatechevent.info;
}
}