Skip to content

Instantly share code, notes, and snippets.

@u1i
Last active September 2, 2017 06:25
Show Gist options
  • Save u1i/baec9d1f1d48e0a0b39978b81daeb17b to your computer and use it in GitHub Desktop.
Save u1i/baec9d1f1d48e0a0b39978b81daeb17b to your computer and use it in GitHub Desktop.
nginx proxy and rewrite
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /soap {
# make sure the /path does not get send to the endpoint
rewrite /soap(.*) /$1 break;
proxy_pass http://127.0.0.1:8083;
proxy_redirect off;
proxy_set_header Host ws1.sotong.io;
# rewrite all output from the process and replace self references with the host address
sub_filter_once off;
sub_filter_types text/xml;
sub_filter "http://127.0.0.1:8083" "http://ws1.sotong.io";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment