Reverse Proxy for blog.imagifyr.com on Siteground.

royalgiant
HOBBY

a year ago

Does anyone run a reverse-proxy to their blog? I am hosting imagifyr.com on railway and blog.imagifyr.com on siteground. I'm not too familiar with networking, but requests pass through railway and the IP address keeps getting blocked by Siteground's bots.

Does anyone know how to resolve this? <@539512869780455445>

P.S. I followed this guide: https://myrailslearnings.wordpress.com/2020/01/18/how-do-i-add-a-wordpress-blog-to-my-rails-app/

0 Replies

a year ago

why was I summoned lol


a year ago

n/a


royalgiant
HOBBY

a year ago

Lol, darn I'm sorry if I woke you up or something, not urgent. Just siteground redirecting me when I'm running a reverse proxy to my blog.


a year ago

I was awake, just curious as to why I was picked to be pinged haha


royalgiant
HOBBY

a year ago

Honestly, because you are a 🐐 . Not because you are the only person I know who is supporting railway on his shoulders. 😅 🙏

LMK if there's someone else I should have pinged instead lol.


a year ago

I assume the blog is wordpress right?


royalgiant
HOBBY

a year ago

Yes sir. WP on siteground.


a year ago

so the obvious solution is to run wordpress on Railway 🙂


royalgiant
HOBBY

a year ago

I tried doing that but failed multiple times. You can have imagifyr.com on one container and blog.imagifyr.com on another and reverse proxy into each other?


a year ago

why do you need a reverse proxy? they are different domains


royalgiant
HOBBY

a year ago

Because imagifyr.com is a rails app hosted on railway and i just wanted imagifyr.com/blog to point to blog.imagifyr.com for SEO purposes which is why I did it that way.


a year ago

by point do you mean redirect?


royalgiant
HOBBY

a year ago

Yes sir, my poor choice of wording. 🙂


a year ago

and that's an in-code redirect?


a year ago

can you send clickable links to both domains, I'm on mobile


royalgiant
HOBBY

a year ago

Yeah, my route is

get "/blog", to: redirect('https://imagifyr.com/blog/', status: 301)

On my rails app.
https://imagifyr.com


royalgiant
HOBBY

a year ago


royalgiant
HOBBY

a year ago

https://blog.imagifyr.com (blog hosted on siteground)


a year ago

do you need access to the filesystem of your wordpress install on siteground?


royalgiant
HOBBY

a year ago

I have access, but do I need to get in there? No.


a year ago

so let's just move your wordpress install to Railway?


a year ago

you could keep the same blog. subdomain


royalgiant
HOBBY

a year ago

Hm. Ok, I will try again. What you're saying is just create a new project "imagifyr-wordpress" for example and that will have the blog. subdomain and I will reverse proxy into that instead?

1258093334203859000


a year ago

You would want to have all services that relate to the other services in the same project, from that screenshot it looks like you are taking backups of your database over the public network and subjecting yourself to egress fees, instead of using the private network, you would want the backup service in the same project so that it can connect to the database via the private network.

you would also want the wordpress site in the same project as well.

and I'm still not seeing any need for a reverse proxy? can you please explain where you think it fits in?


royalgiant
HOBBY

a year ago

RE: Backup, yeah it's on AWS right now and I'm not doing such volume that it will cost me much (right now it's nothing).

RE: So I would put the WP site in imagifyr from what it sounds like?

RE: Reverse proxy. Networking noob here. But I'm imagining, if I have another service (Wordpress with blog.imagifyr.com). It would be accessed via blog.imagifyr.com.

But I want that blog accessible at imagifyr.com/blog instead. That's where I think the reverse proxy is necessary?

1258095819911991300


a year ago

so you aren't happy with just the redirect?


royalgiant
HOBBY

a year ago

Sorry, not on the same page I think. I'm fine with the redirect. imagifyr.com/blog just needs to be able to reach the wordpress blog.

If your suggested setup accomplishes that, I'm good.


a year ago

yeah then you don't need a reverse proxy, you just attach the blog subdomain to the wordpress service


a year ago

why does the imagifyr service have a wildcard?


royalgiant
HOBBY

a year ago

It was just setup that way. Should I not have the wildcard?


a year ago

if you don't need a wildcard, there's no reason to have one


royalgiant
HOBBY

a year ago

Gotcha, I will give this a shot over the weekend. Thanks for the lessons sir!


a year ago

yeah just deploy the wordpress template Jack made, don't worry about the domain yet, just use the railway provided domain to get it all setup, then use some kind of wordpress backup and restore plugin to backup the wordpress install on your old host and restore it to the wordpress install on railway


royalgiant
HOBBY

a year ago

See. G.O.A.T i tell you! G.O.A.T!

Thanks for your help this morning sir! Hope you have a happy 4th!


a year ago

haha I'm not American, but thank you 🙂


royalgiant
HOBBY

a year ago

@Jack anyway to increase the max upload filesize to more than 50mb? https://help.servmask.com/2018/10/27/how-to-increase-maximum-upload-file-size-in-wordpress/

I am importing my WP from siteground to here but the file size is about 150mb…


royalgiant
HOBBY

a year ago

Would be nice if I can go access the .htaccess or something and just edit it.


a year ago

how large is your backup file?


royalgiant
HOBBY

a year ago

About 150MB.


a year ago

try setting the WORDPRESS_CONFIG_EXTRA variable to -

define('DOMAIN_CURRENT_SITE','${{RAILWAY_PUBLIC_DOMAIN}}');define('WP_HOME','https://${{RAILWAY_PUBLIC_DOMAIN}}');define('WP_SITEURL','https://${{RAILWAY_PUBLIC_DOMAIN}}');@ini_set('upload_max_filesize','200M');@ini_set('post_max_size','200M');@ini_set('memory_limit','500M');@ini_set('max_execution_time','500');@ini_set('max_input_time','500');

royalgiant
HOBBY

a year ago

OK trying. Would
@ini_set('upload_max_filesize','128M') be something like @ini_set('upload_max_filesize','170M') if my import file is 157MB though?


a year ago

oh, sorry didnt notice the edit


a year ago

edited


royalgiant
HOBBY

a year ago

Np. Deploying now! Thanks for the help!


royalgiant
HOBBY

a year ago

Sorry to keep bugging you, but the WORDPRESS_CONFIG_EXTRA didn't seem to update the upload limit or do I have to wait for post deploy to finish because it's been stuck like that for some time.

1258601386115989500
1258601386447343600


a year ago

are you sure that isnt a limitation of the plugin?


royalgiant
HOBBY

a year ago

Pretty certain. I made another edit to bring up Plugin Editor:
https://www.ionos.com/digitalguide/hosting/blogs/activate-wordpress-theme-and-plug-in-editor/

define('DOMAIN_CURRENT_SITE','blog.pinagenda.com');define('WP_HOME','https://blog.pinagenda.com');define('WP_SITEURL','https://blog.pinagenda.com');@ini_set('upload_max_filesize','200M');@ini_set('post_max_size','200M');@ini_set('memory_limit','500M');@ini_set('max_execution_time','500');@ini_set('max_input_time','500');define('DISALLOW_FILE_EDIT', false);

With define('DISALLOW_FILE_EDIT', false)

And it isn't being applied. I'm using All in one WP Migration and according to this blog: https://wpadventure.com/how-to-increase-the-all-in-one-wp-migration-plugin-upload-import-limit/

The default seems to be 512MB.

My hunch is that the deploying isn't taking notice of the WORDPRESS_CONFIG_EXTRA

1258612238298906600


a year ago

okay ill deploy wordpress and see what i can figure out


royalgiant
HOBBY

a year ago

Sorry for the trouble and thanks for your help!


a year ago

no problem!


a year ago

> Remove upload limits


a year ago

you might have better luck with backing up the database on your current host and restoring it to the database on railway, and then copying over your /var/www/html folder on your current host into the volume on the mysql service


royalgiant
HOBBY

a year ago

Might just copy and paste the posts, I'm not sure how to do that. There's only 9 posts so far.


a year ago

whatever works best for you


royalgiant
HOBBY

a year ago

Thanks for your help today anyways!


a year ago

no problem