https://www.mobile01.com/topicdetail.php?f=651&t=5310046
https://www.mobile01.com/topicdetail.php?f=651&t=5310046#10
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=2#11
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=2#14
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=2#15
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=3#26
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=4#40
https://www.mobile01.com/topicdetail.php?f=651&t=5310046&p=18#176
1、/etc/nginx/nginx.conf
worker_processes 1; #auto;
events {
worker_connections 3000; #786;
# multi_accept on;
}
http {
server_tokens off; #open this line
resolver 8.8.8.8 8.8.4.4 valid=300s; #resolver dns server
proxy_cache_path /var/cache/proxy-nginx levels=1:2 keys_zone=proxy-cache:10m max_size=3g inactive=1d use_temp_path=off;
add_header X-Cache $upstream_cache_status; #讓Header顯示是否有Cache:HIT命中 MISS失敗 BYPASS略過
proxy_headers_hash_max_size 51200; #add this line
proxy_headers_hash_bucket_size 6400; #add this line
log_format main ‘$remote_addr $status $request $body_bytes_sent [$time_local] $http_user_agent $http_referer $http_x_forwarded_for $upstream_addr $upstream_status $upstream_cache_status $upstream_response_time’;
Better way is Amazon Linux and
Enhanced Networking on Linux C3、C4、M4
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sriov-networking.html
I think is better for performace.
1、
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html#NATSG
1.1、Create instance form ami :ami-vpc-nat-hvm choese best new
***NAT AMI***
1.2、
Check.IPv4 forwarding is enabled and ICMP redirects are disabled in /etc/sysctl.d/10-nat-settings.conf
IPv4 forwarding =1
Run.A script located at /usr/sbin/configure-pat.sh runs at startup and configures iptables IP masquerading.
Here have problem, so must delete POSTROUTING
sudo iptables -t nat -D POSTROUTING 1
2、
https://holtstrom.com/michael/blog/post/400/Port-Forwarding-Gateway-via-iptables-on-Linux.html
eth0 10.0.0.219 52.78.165.129
eth1 10.0.1.149
web server 10.0.1.249
iptables -vxnL –line-numbers
iptables -t nat -vxnL –line-numbers
https://github.com/agsh/rtsp-ffmpeg
this is ok