| 1 | nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
|---|
| 2 | nginx: configuration file /etc/nginx/nginx.conf test is successful
|
|---|
| 3 | # configuration file /etc/nginx/nginx.conf:
|
|---|
| 4 | user root;
|
|---|
| 5 | worker_processes 1;
|
|---|
| 6 |
|
|---|
| 7 | error_log /var/log/nginx/error.log warn;
|
|---|
| 8 | pid /var/run/nginx.pid;
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | events {
|
|---|
| 12 | worker_connections 1024;
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | http {
|
|---|
| 18 | include /etc/nginx/mime.types;
|
|---|
| 19 | default_type application/octet-stream;
|
|---|
| 20 |
|
|---|
| 21 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|---|
| 22 | '$status $body_bytes_sent "$http_referer" '
|
|---|
| 23 | '"$http_user_agent" "$http_x_forwarded_for"';
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | log_format custom '$remote_addr - $remote_user [$time_local] "$request" '
|
|---|
| 30 | '$status $body_bytes_sent "$http_referer" '
|
|---|
| 31 | '"$http_user_agent" "$http_x_forwarded_for"';
|
|---|
| 32 |
|
|---|
| 33 | log_format upstream_time '$remote_addr - $remote_user [$time_local] '
|
|---|
| 34 | '"$request" $status $body_bytes_sent '
|
|---|
| 35 | '"$http_referer" "$http_user_agent"'
|
|---|
| 36 | 'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
|
|---|
| 37 |
|
|---|
| 38 | access_log /var/log/nginx/access.log upstream_time;
|
|---|
| 39 |
|
|---|
| 40 | sendfile on;
|
|---|
| 41 | #tcp_nopush on;
|
|---|
| 42 |
|
|---|
| 43 | keepalive_timeout 65;
|
|---|
| 44 |
|
|---|
| 45 | #gzip on;
|
|---|
| 46 |
|
|---|
| 47 | underscores_in_headers on;
|
|---|
| 48 | ignore_invalid_headers off;
|
|---|
| 49 |
|
|---|
| 50 | include /etc/nginx/conf.d/*.conf;
|
|---|
| 51 | client_max_body_size 25M;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | # configuration file /etc/nginx/mime.types:
|
|---|
| 56 |
|
|---|
| 57 | types {
|
|---|
| 58 | text/html html htm shtml;
|
|---|
| 59 | text/css css;
|
|---|
| 60 | text/xml xml;
|
|---|
| 61 | image/gif gif;
|
|---|
| 62 | image/jpeg jpeg jpg;
|
|---|
| 63 | application/javascript js;
|
|---|
| 64 | application/atom+xml atom;
|
|---|
| 65 | application/rss+xml rss;
|
|---|
| 66 |
|
|---|
| 67 | text/mathml mml;
|
|---|
| 68 | text/plain txt;
|
|---|
| 69 | text/vnd.sun.j2me.app-descriptor jad;
|
|---|
| 70 | text/vnd.wap.wml wml;
|
|---|
| 71 | text/x-component htc;
|
|---|
| 72 |
|
|---|
| 73 | image/png png;
|
|---|
| 74 | image/svg+xml svg svgz;
|
|---|
| 75 | image/tiff tif tiff;
|
|---|
| 76 | image/vnd.wap.wbmp wbmp;
|
|---|
| 77 | image/webp webp;
|
|---|
| 78 | image/x-icon ico;
|
|---|
| 79 | image/x-jng jng;
|
|---|
| 80 | image/x-ms-bmp bmp;
|
|---|
| 81 |
|
|---|
| 82 | font/woff woff;
|
|---|
| 83 | font/woff2 woff2;
|
|---|
| 84 |
|
|---|
| 85 | application/java-archive jar war ear;
|
|---|
| 86 | application/json json;
|
|---|
| 87 | application/mac-binhex40 hqx;
|
|---|
| 88 | application/msword doc;
|
|---|
| 89 | application/pdf pdf;
|
|---|
| 90 | application/postscript ps eps ai;
|
|---|
| 91 | application/rtf rtf;
|
|---|
| 92 | application/vnd.apple.mpegurl m3u8;
|
|---|
| 93 | application/vnd.google-earth.kml+xml kml;
|
|---|
| 94 | application/vnd.google-earth.kmz kmz;
|
|---|
| 95 | application/vnd.ms-excel xls;
|
|---|
| 96 | application/vnd.ms-fontobject eot;
|
|---|
| 97 | application/vnd.ms-powerpoint ppt;
|
|---|
| 98 | application/vnd.oasis.opendocument.graphics odg;
|
|---|
| 99 | application/vnd.oasis.opendocument.presentation odp;
|
|---|
| 100 | application/vnd.oasis.opendocument.spreadsheet ods;
|
|---|
| 101 | application/vnd.oasis.opendocument.text odt;
|
|---|
| 102 | application/vnd.openxmlformats-officedocument.presentationml.presentation
|
|---|
| 103 | pptx;
|
|---|
| 104 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
|---|
| 105 | xlsx;
|
|---|
| 106 | application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|---|
| 107 | docx;
|
|---|
| 108 | application/vnd.wap.wmlc wmlc;
|
|---|
| 109 | application/x-7z-compressed 7z;
|
|---|
| 110 | application/x-cocoa cco;
|
|---|
| 111 | application/x-java-archive-diff jardiff;
|
|---|
| 112 | application/x-java-jnlp-file jnlp;
|
|---|
| 113 | application/x-makeself run;
|
|---|
| 114 | application/x-perl pl pm;
|
|---|
| 115 | application/x-pilot prc pdb;
|
|---|
| 116 | application/x-rar-compressed rar;
|
|---|
| 117 | application/x-redhat-package-manager rpm;
|
|---|
| 118 | application/x-sea sea;
|
|---|
| 119 | application/x-shockwave-flash swf;
|
|---|
| 120 | application/x-stuffit sit;
|
|---|
| 121 | application/x-tcl tcl tk;
|
|---|
| 122 | application/x-x509-ca-cert der pem crt;
|
|---|
| 123 | application/x-xpinstall xpi;
|
|---|
| 124 | application/xhtml+xml xhtml;
|
|---|
| 125 | application/xspf+xml xspf;
|
|---|
| 126 | application/zip zip;
|
|---|
| 127 |
|
|---|
| 128 | application/octet-stream bin exe dll;
|
|---|
| 129 | application/octet-stream deb;
|
|---|
| 130 | application/octet-stream dmg;
|
|---|
| 131 | application/octet-stream iso img;
|
|---|
| 132 | application/octet-stream msi msp msm;
|
|---|
| 133 |
|
|---|
| 134 | audio/midi mid midi kar;
|
|---|
| 135 | audio/mpeg mp3;
|
|---|
| 136 | audio/ogg ogg;
|
|---|
| 137 | audio/x-m4a m4a;
|
|---|
| 138 | audio/x-realaudio ra;
|
|---|
| 139 |
|
|---|
| 140 | video/3gpp 3gpp 3gp;
|
|---|
| 141 | video/mp2t ts;
|
|---|
| 142 | video/mp4 mp4;
|
|---|
| 143 | video/mpeg mpeg mpg;
|
|---|
| 144 | video/quicktime mov;
|
|---|
| 145 | video/webm webm;
|
|---|
| 146 | video/x-flv flv;
|
|---|
| 147 | video/x-m4v m4v;
|
|---|
| 148 | video/x-mng mng;
|
|---|
| 149 | video/x-ms-asf asx asf;
|
|---|
| 150 | video/x-ms-wmv wmv;
|
|---|
| 151 | video/x-msvideo avi;
|
|---|
| 152 | }
|
|---|
| 153 |
|
|---|
| 154 | # configuration file /etc/nginx/conf.d/vijay.conf:
|
|---|
| 155 | upstream vijaycontrol {
|
|---|
| 156 |
|
|---|
| 157 | server appserver1:30001;
|
|---|
| 158 | }
|
|---|
| 159 |
|
|---|
| 160 | upstream vijayapi {
|
|---|
| 161 |
|
|---|
| 162 | server appserver1:30002;
|
|---|
| 163 | server appserver2:30002;
|
|---|
| 164 |
|
|---|
| 165 | }
|
|---|
| 166 |
|
|---|
| 167 | upstream vijayledger {
|
|---|
| 168 |
|
|---|
| 169 | server appserver1:30003;
|
|---|
| 170 | }
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 | server {
|
|---|
| 174 |
|
|---|
| 175 | listen 3601 ssl;
|
|---|
| 176 | server_name 192.168.100.123;
|
|---|
| 177 | include common/force-ssl.conf;
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 | ssl_certificate /etc/nginx/ssl_new/nginx_cert.crt;
|
|---|
| 181 | ssl_certificate_key /etc/nginx/ssl_new/nginx_cert.key;
|
|---|
| 182 | ssl_trusted_certificate /etc/nginx/ssl_new/nginx_cert.ca;
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 | ssl_protocols TLSv1.2;
|
|---|
| 187 | ssl_prefer_server_ciphers on;
|
|---|
| 188 | ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
|---|
| 189 | ssl_ecdh_curve secp384r1;
|
|---|
| 190 | ssl_session_cache shared:SSL:10m;
|
|---|
| 191 | ssl_session_tickets off;
|
|---|
| 192 | ssl_stapling on;
|
|---|
| 193 | ssl_stapling_verify on;
|
|---|
| 194 | resolver 8.8.8.8 8.8.4.4 valid=300s;
|
|---|
| 195 | resolver_timeout 5s;
|
|---|
| 196 | add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
|
|---|
| 197 | add_header X-Frame-Options DENY;
|
|---|
| 198 | add_header X-Content-Type-Options nosniff;
|
|---|
| 199 |
|
|---|
| 200 | ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
|---|
| 201 |
|
|---|
| 202 | location /vijaycontrol {
|
|---|
| 203 | proxy_pass http://vijaycontrol;
|
|---|
| 204 | proxy_set_header Host $host;
|
|---|
| 205 | proxy_set_header X-Forwarded-Proto $scheme;
|
|---|
| 206 | proxy_set_header X-Real-IP $remote_addr;
|
|---|
| 207 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 208 | }
|
|---|
| 209 |
|
|---|
| 210 | }
|
|---|
| 211 |
|
|---|
| 212 | server {
|
|---|
| 213 | listen 36003 ssl;
|
|---|
| 214 | server_name vijayapi;
|
|---|
| 215 |
|
|---|
| 216 | ssl_certificate /etc/nginx/ssl_new/nginx_cert.crt;
|
|---|
| 217 | ssl_certificate_key /etc/nginx/ssl_new/nginx_cert.key;
|
|---|
| 218 | ssl_trusted_certificate /etc/nginx/ssl_new/nginx_cert.ca;
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 | ssl_client_certificate /etc/pki/CA/newcerts/ca.crt;
|
|---|
| 222 | ssl_verify_client on;
|
|---|
| 223 |
|
|---|
| 224 | proxy_ssl_server_name on;
|
|---|
| 225 |
|
|---|
| 226 | ssl_session_timeout 5m;
|
|---|
| 227 |
|
|---|
| 228 | ssl_prefer_server_ciphers on;
|
|---|
| 229 | ssl_protocols TLSv1.2;
|
|---|
| 230 | ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK';
|
|---|
| 231 |
|
|---|
| 232 | keepalive_timeout 10;
|
|---|
| 233 |
|
|---|
| 234 | location /api/pws {
|
|---|
| 235 | proxy_pass http://vijayapi/api/pws;
|
|---|
| 236 | proxy_set_header Host $host;
|
|---|
| 237 | proxy_set_header X-Forwarded-Proto $scheme;
|
|---|
| 238 | proxy_set_header X-Real-IP $remote_addr;
|
|---|
| 239 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 240 | }
|
|---|
| 241 |
|
|---|
| 242 | }
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | server {
|
|---|
| 246 | listen 9876;
|
|---|
| 247 | server_name 192.168.100.123;
|
|---|
| 248 |
|
|---|
| 249 | keepalive_timeout 10;
|
|---|
| 250 |
|
|---|
| 251 | location / {
|
|---|
| 252 | resolver 4.4.4.4;;
|
|---|
| 253 |
|
|---|
| 254 | proxy_ssl_server_name on;
|
|---|
| 255 | proxy_pass https://mysite.api.prod.vijay.com/speed/send;
|
|---|
| 256 |
|
|---|
| 257 | }
|
|---|
| 258 | }
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
|
|---|
| 263 | # configuration file /etc/nginx/common/force-ssl.conf:
|
|---|
| 264 | if ($scheme = 'http')
|
|---|
| 265 | {
|
|---|
| 266 | rewrite ^ https://$server_name$request_uri? permanent;
|
|---|
| 267 | } |
|---|