Skip to content

Instantly share code, notes, and snippets.

@thapakazi
Last active January 29, 2021 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thapakazi/c3864201893dfadcb8659c6855aefeab to your computer and use it in GitHub Desktop.
Save thapakazi/c3864201893dfadcb8659c6855aefeab to your computer and use it in GitHub Desktop.
dead simple and boring nginx config to redirect whaterver comes to /google to google.com/search?q=$1
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /google{
rewrite ^/google(.*)$ https://google.com/search?q=$1 redirect;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment