Skip to content

Instantly share code, notes, and snippets.

@magicalyak
Last active May 22, 2019 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magicalyak/35bc2f0d4f394419694bf8cb594bbc33 to your computer and use it in GitHub Desktop.
Save magicalyak/35bc2f0d4f394419694bf8cb594bbc33 to your computer and use it in GitHub Desktop.
NGINX Testing
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 120;
keepalive_requests 100000;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
upstream MV {
zone MV 64k;
least_time header;
server utstengsrv29:8082 slow_start=10s;
server utstengsrv34:8082 slow_start=10s;
server utstengsrv36:8082 slow_start=10s;
}
upstream tpcq {
zone tpcq 64K;
least_time header;
server utstengsrv54:8082 slow_start=10s;
server utstengsrv55:8082 slow_start=10s;
server utstengsrv56:8082 slow_start=10s;
}
server {
status_zone MV;
location / {
proxy_pass http://MV;
#health_check port=8081;
}
location ~ /v2/totalprice(.*)$ {
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://tpcq;
}
}
server {
listen 8080;
#access_log off;
location /api {
api;
#api write=on;
#allow 127.0.0.1;
#deny all;
}
location / {
return 301 /dashboard.html;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
location /swagger-ui {
root /usr/share/nginx/html;
# Everything beginning with /status (except for /status.html) is
# processed by the status handler
# location /status {
# status;
}
}
}
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 120;
keepalive_requests 100000;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
upstream MV {
zone MV 64k;
least_time header;
server utstengsrv29:8082 slow_start=10s;
server utstengsrv34:8082 slow_start=10s;
server utstengsrv36:8082 slow_start=10s;
}
upstream tpcq {
zone tpcq 64K;
least_time header;
server utstengsrv54:8082 slow_start=10s;
server utstengsrv54:8082 slow_start=10s;
server utstengsrv54:8082 slow_start=10s;
}
server {
status_zone MV;
location /MV {
proxy_pass http://MV;
#health_check port=8081;
}
}
server {
status_zone tpcq;
location /totalpriceCQ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://tpcq;
}
}
server {
listen 8080;
#access_log off;
location /api {
api;
#api write=on;
#allow 127.0.0.1;
#deny all;
}
location / {
return 301 /dashboard.html;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
location /swagger-ui {
root /usr/share/nginx/html;
# Everything beginning with /status (except for /status.html) is
# processed by the status handler
# location /status {
# status;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment