text 羽毛.js的初始nginx配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 羽毛.js的初始nginx配置相关的知识,希望对你有一定的参考价值。
upstream app_server {
ip_hash;
server app_react:3000 max_fails=3 fail_timeout=30s;
}
upstream api_server {
ip_hash;
server api_feathers:3040 max_fails=3 fail_timeout=30s;
}
# this section is needed to proxy web-socket connections
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
ssl on;
ssl_certificate /work/ssl/certificate-bundle.pem;
ssl_certificate_key /work/ssl/private-key-nopass.pem;
location /favicon.ico {
alias /assets/web/favicon.ico;
}
location /assets/ {
rewrite ^/assets/(.*) /$1 break;
root /assets/web;
autoindex off;
}
# Make site accessible from http://localhost/
server_name io.nesteggs.ca;
client_max_body_size 20M;
proxy_max_temp_file_size 2048m; # default 1024m
rewrite_log on;
location / {
#access_log off;
proxy_pass http://app_server;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_cache off;
proxy_cache_bypass $http_upgrade;
add_header Cache-Control no-cache;
proxy_set_header Upgrade $http_upgrade; #for websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-Host $host;
proxy_set_header X-Real-Uri $request_uri;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Referer $http_referer;
proxy_pass_header Authorization;
proxy_pass_header Set-Cookie;
}
location /socket.io {
#access_log off;
proxy_pass http://api_server;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_cache off;
proxy_cache_bypass $http_upgrade;
add_header Cache-Control no-cache;
proxy_set_header Upgrade $http_upgrade; #for websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-Host $host;
proxy_set_header X-Real-Uri $request_uri;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Referer $http_referer;
proxy_pass_header Authorization;
proxy_pass_header Set-Cookie;
}
#location /api {
# return 302 $uri/;
#}
location /api/ {
#access_log off;
rewrite ^/api/(.*) /$1 break;
proxy_pass http://api_server;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_cache off;
proxy_cache_bypass $http_upgrade;
add_header Cache-Control no-cache;
proxy_set_header Upgrade $http_upgrade; #for websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Scheme $scheme;
proxy_set_header X-Real-Host $host;
proxy_set_header X-Real-Uri $request_uri;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Referer $http_referer;
proxy_pass_header Authorization;
proxy_pass_header Set-Cookie;
}
}
以上是关于text 羽毛.js的初始nginx配置的主要内容,如果未能解决你的问题,请参考以下文章
Nginx failing to load CSS and JS files (MIME type error)
typescript 这些是Feathers.js的基本类型,基于DefinitelyTyped for Express中的那些。这不是羽毛插件的类型,但确实有