Skip to content

Instantly share code, notes, and snippets.

@maybephilipp
Created January 10, 2023 10:26
Show Gist options
  • Save maybephilipp/0042f3ec56fc003a93972c9b18116392 to your computer and use it in GitHub Desktop.
Save maybephilipp/0042f3ec56fc003a93972c9b18116392 to your computer and use it in GitHub Desktop.
Proxying Wix under nginx, proxy_pass

Seems to be working only without domain name tied to Wix site. 100% works with premium + free wix address as of Jan 10th 2023.

location ~ ^/(.*)$ {
    gzip off;
    proxy_ssl_server_name on;
    proxy_set_header Accept-Encoding "";
    proxy_set_header X-Forwarded-Host "";
    proxy_set_header X-Forwarded-For "";
    proxy_set_header Referer https://username.wixsite.com/sitename;
    add_header Host username.wixsite.com;
    proxy_pass_request_headers on;
    proxy_http_version 1.1;

    resolver 8.8.8.8;
    proxy_pass https://username.wixsite.com/sitename/$1$is_args$args;

    sub_filter_types text/html application/javascript application/x-javascript text/javascript;
    sub_filter "https%3A%2F%2Fusername.wixsite.com%2Ffinsimco" "https%3A%2F%2F$http_host";
    sub_filter "https%3A%2F%2Fusername.wixsite.com" "https%3A%2F%2F$http_host";
    sub_filter https://username.wixsite.com/sitename https://$http_host;
    sub_filter https://username.wixsite.com https://$http_host;
    sub_filter "https:\/\/username.wixsite.com\/sitename" "https:\/\/$http_host";
    sub_filter "https:\/\/username.wixsite.com" "https:\/\/$http_host";
    sub_filter_once off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment