Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
}
@hlashbrooke

This comment has been minimized.

Copy link
Owner Author

hlashbrooke commented Nov 12, 2015

This is to be put in the server directive for your site running Seriously Simple Podcasting. It basically tells all requests to the podcast-download and podcast-player endpoints to process as a .php file, even though the URL states that it is an .mp3, and bypasses it through to PHP-FPM.

You may need to change fastcgi_pass 127.0.0.1:9000; to match that of your PHP-FPM configuration.

@JanThiel

This comment has been minimized.

Copy link

JanThiel commented Apr 22, 2017

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

TheCraigHewitt/Seriously-Simple-Podcasting#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

This comment has been minimized.

Copy link

JuanGonzalez180 commented Oct 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.