-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.nginx.conf
49 lines (43 loc) · 1.68 KB
/
.nginx.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
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log /nfs/public/rw/webadmin/tomcat/bases/pride/tc-pst-webdist-dev/error.log info;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
access_log /tmp/access.log;
#error_log /nfs/public/rw/webadmin/tomcat/bases/pride/tc-pst-webdist-dev/logs/error.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8080;
server_name localhost;
if ($request_uri ~* "/pride$") {
rewrite ^(.*)$ $scheme://$http_host$1/ permanent;
}
location /pride {
proxy_set_header X-URL $scheme://$host$request_uri;
if ($http_user_agent ~* "Baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator|bingbot|Sosospider|Sogou Pic Spider|Googlebot|360Spider") {
proxy_pass $PRIDE_WEB_SSR_URL;
}
gzip on;
gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json application/octet-stream image/jpeg image/png image/gif;
expires 3600;
add_header X-nginx-test "pride-web";
root /usr/share;
try_files $uri $uri/index.html /pride/index.html;
#error_page 404 /404.html;
}
}
}