Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Main location block for the application
- location ^~ / {
- proxy_pass https://localhost:2222/index.php/sdfsfaf/;
- proxy_set_header Host baidu.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $http_connection;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_http_version 1.1;
- add_header X-Cache $upstream_cache_status;
- add_header Cache-Control no-cache;
- proxy_ssl_server_name off;
- proxy_ssl_name $proxy_host;
- add_header Strict-Transport-Security "max-age=31536000";
- proxy_set_header Accept-Encoding "";
- # Handle redirects
- proxy_redirect https://baidu.com/index.php/sdfsfaf/ https://google.com/;
- proxy_redirect http://baidu.com/index.php/sdfsfaf/ http://google.com/;
- # Handle cookie domains
- proxy_cookie_domain baidu.com google.com;
- proxy_cookie_path /index.php/sdfsfaf /;
- sub_filter_once off;
- sub_filter_types *;
- sub_filter "baidu.com/index.php/sdfsfaf" "google.com";
- sub_filter "baidu.com" "google.com";
- }
- # Special location for AJAX calls that need to keep index.php/sdfsfaf in the path
- location ~* /index.php/sdfsfaf/\$\$\$call\$\$\$ {
- # Don't rewrite the path - pass it directly
- proxy_pass https://localhost:2222;
- proxy_set_header Host baidu.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_http_version 1.1;
- proxy_ssl_server_name off;
- proxy_ssl_name $proxy_host;
- # No redirects or subfilters here - we want to pass these requests unchanged
- }
- # For /styles path
- location ^~ /styles/ {
- proxy_pass https://localhost:2222/styles/;
- proxy_set_header Host baidu.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_http_version 1.1;
- proxy_ssl_server_name off;
- proxy_ssl_name $proxy_host;
- # Cache static resources
- add_header Cache-Control "public, max-age=31536000";
- # Replace any URLs in the response
- sub_filter_once off;
- sub_filter_types *;
- sub_filter "baidu.com" "google.com";
- }
- # For /lib path (fonts, etc.)
- location ^~ /lib/ {
- proxy_pass https://localhost:2222/lib/;
- proxy_set_header Host baidu.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_http_version 1.1;
- proxy_ssl_server_name off;
- proxy_ssl_name $proxy_host;
- # Cache static resources
- add_header Cache-Control "public, max-age=31536000";
- # Replace any URLs in the response
- sub_filter_once off;
- sub_filter_types *;
- sub_filter "baidu.com" "google.com";
- }
- # For /js path
- location ^~ /js/ {
- proxy_pass https://localhost:2222/js/;
- proxy_set_header Host baidu.com;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_http_version 1.1;
- proxy_ssl_server_name off;
- proxy_ssl_name $proxy_host;
- # Cache static resources
- add_header Cache-Control "public, max-age=31536000";
- # Replace any URLs in the response
- sub_filter_once off;
- sub_filter_types *;
- sub_filter "baidu.com" "google.com";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement