Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created November 11, 2015 19:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hlashbrooke/89adb00d530aea5bc66d to your computer and use it in GitHub Desktop.
Save hlashbrooke/89adb00d530aea5bc66d to your computer and use it in GitHub Desktop.
Seriously Simple Podcasting: Fix for Nginx servers where the podcast downloads and audio player are not working and/or returning a 404 error.
location ~* ^/podcast-download/ {
try_files $uri $uri/
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
location ~* ^/podcast-player/ {
try_files $uri $uri/
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
@JanThiel
Copy link

Hi @hlashbrooke could you please reconsider this Gist. Please take a look here:

https://github.com/TheCraigHewitt/Seriously-Simple-Podcasting/issues/131

tldr;
The above config is a security risk and to unflexible, use this instead:

# Seriously Simple Podcasting
rewrite podcast-download/([^/]+)/([^/]*)/? /index.php?podcast_episode=$1 break;
rewrite podcast-player/([^/]+)/([^/]*)/? /index.php?podcast_episode=$1&podcast_ref=player break;

The nginx config in your gist opens up some attack vectors on nginx + php-fpm servers that could be avoided easily. As this gist is directly linked on the help pages of the simple podcasting plugin changing it here should do the trick.

Thanks,

Jan

@JuanGonzalez180
Copy link

Is there any way for the "rewrite" to be configured for all domains and subdomains of the Server?

@d1mf
Copy link

d1mf commented Sep 13, 2020

Thanks. Work

@denismoc
Copy link

I've only encountered this issue now for some reason? Everything was working fine then all of a sudden media not found.
Any idea if there is an official fix for this yet?
My site is deployed on Kubernetes so can't really edit my nginx. Any way this can be done through Wordpress files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment