Advertisement
Guest User

Untitled

a guest
Apr 21st, 2025
9
0
29 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. # Main location block for the application
  2. location ^~ / {
  3. proxy_pass https://localhost:2222/index.php/sdfsfaf/;
  4. proxy_set_header Host baidu.com;
  5. proxy_set_header X-Real-IP $remote_addr;
  6. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  7. proxy_set_header REMOTE-HOST $remote_addr;
  8. proxy_set_header Upgrade $http_upgrade;
  9. proxy_set_header Connection $http_connection;
  10. proxy_set_header X-Forwarded-Proto $scheme;
  11. proxy_http_version 1.1;
  12. add_header X-Cache $upstream_cache_status;
  13. add_header Cache-Control no-cache;
  14. proxy_ssl_server_name off;
  15. proxy_ssl_name $proxy_host;
  16. add_header Strict-Transport-Security "max-age=31536000";
  17. proxy_set_header Accept-Encoding "";
  18.  
  19. # Handle redirects
  20. proxy_redirect https://baidu.com/index.php/sdfsfaf/ https://google.com/;
  21. proxy_redirect http://baidu.com/index.php/sdfsfaf/ http://google.com/;
  22.  
  23. # Handle cookie domains
  24. proxy_cookie_domain baidu.com google.com;
  25. proxy_cookie_path /index.php/sdfsfaf /;
  26.  
  27. sub_filter_once off;
  28. sub_filter_types *;
  29. sub_filter "baidu.com/index.php/sdfsfaf" "google.com";
  30. sub_filter "baidu.com" "google.com";
  31. }
  32.  
  33. # Special location for AJAX calls that need to keep index.php/sdfsfaf in the path
  34. location ~* /index.php/sdfsfaf/\$\$\$call\$\$\$ {
  35. # Don't rewrite the path - pass it directly
  36. proxy_pass https://localhost:2222;
  37. proxy_set_header Host baidu.com;
  38. proxy_set_header X-Real-IP $remote_addr;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. proxy_http_version 1.1;
  41. proxy_ssl_server_name off;
  42. proxy_ssl_name $proxy_host;
  43.  
  44. # No redirects or subfilters here - we want to pass these requests unchanged
  45. }
  46.  
  47. # For /styles path
  48. location ^~ /styles/ {
  49. proxy_pass https://localhost:2222/styles/;
  50. proxy_set_header Host baidu.com;
  51. proxy_set_header X-Real-IP $remote_addr;
  52. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  53. proxy_http_version 1.1;
  54. proxy_ssl_server_name off;
  55. proxy_ssl_name $proxy_host;
  56.  
  57. # Cache static resources
  58. add_header Cache-Control "public, max-age=31536000";
  59.  
  60. # Replace any URLs in the response
  61. sub_filter_once off;
  62. sub_filter_types *;
  63. sub_filter "baidu.com" "google.com";
  64. }
  65.  
  66. # For /lib path (fonts, etc.)
  67. location ^~ /lib/ {
  68. proxy_pass https://localhost:2222/lib/;
  69. proxy_set_header Host baidu.com;
  70. proxy_set_header X-Real-IP $remote_addr;
  71. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  72. proxy_http_version 1.1;
  73. proxy_ssl_server_name off;
  74. proxy_ssl_name $proxy_host;
  75.  
  76. # Cache static resources
  77. add_header Cache-Control "public, max-age=31536000";
  78.  
  79. # Replace any URLs in the response
  80. sub_filter_once off;
  81. sub_filter_types *;
  82. sub_filter "baidu.com" "google.com";
  83. }
  84.  
  85. # For /js path
  86. location ^~ /js/ {
  87. proxy_pass https://localhost:2222/js/;
  88. proxy_set_header Host baidu.com;
  89. proxy_set_header X-Real-IP $remote_addr;
  90. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  91. proxy_http_version 1.1;
  92. proxy_ssl_server_name off;
  93. proxy_ssl_name $proxy_host;
  94.  
  95. # Cache static resources
  96. add_header Cache-Control "public, max-age=31536000";
  97.  
  98. # Replace any URLs in the response
  99. sub_filter_once off;
  100. sub_filter_types *;
  101. sub_filter "baidu.com" "google.com";
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement