Reverse Proxy for blog.imagifyr.com on Siteground.
royalgiant
HOBBYOP

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/

56 Replies

brody
EMPLOYEE

a year ago

why was I summoned lol


brody
EMPLOYEE

a year ago

n/a


royalgiant
HOBBYOP

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.


brody
EMPLOYEE

a year ago

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


royalgiant
HOBBYOP

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.


brody
EMPLOYEE

a year ago

I assume the blog is wordpress right?


royalgiant
HOBBYOP

a year ago

Yes sir. WP on siteground.


brody
EMPLOYEE

a year ago

so the obvious solution is to run wordpress on Railway 🙂


royalgiant
HOBBYOP

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?


brody
EMPLOYEE

a year ago

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


royalgiant
HOBBYOP

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.


brody
EMPLOYEE

a year ago

by point do you mean redirect?


royalgiant
HOBBYOP

a year ago

Yes sir, my poor choice of wording. 🙂


brody
EMPLOYEE

a year ago

and that's an in-code redirect?


brody
EMPLOYEE

a year ago

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


royalgiant
HOBBYOP

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
HOBBYOP

a year ago


royalgiant
HOBBYOP

a year ago

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


brody
EMPLOYEE

a year ago

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


royalgiant
HOBBYOP

a year ago

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


brody
EMPLOYEE

a year ago

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


brody
EMPLOYEE

a year ago

you could keep the same blog. subdomain


royalgiant
HOBBYOP

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


brody
EMPLOYEE

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
HOBBYOP

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


brody
EMPLOYEE

a year ago

so you aren't happy with just the redirect?


royalgiant
HOBBYOP

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.


brody
EMPLOYEE

a year ago

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


brody
EMPLOYEE

a year ago

why does the imagifyr service have a wildcard?


royalgiant
HOBBYOP

a year ago

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


brody
EMPLOYEE

a year ago

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


royalgiant
HOBBYOP

a year ago

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


brody
EMPLOYEE

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
HOBBYOP

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!


brody
EMPLOYEE

a year ago

haha I'm not American, but thank you 🙂


royalgiant
HOBBYOP

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
HOBBYOP

a year ago

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


brody
EMPLOYEE

a year ago

how large is your backup file?


royalgiant
HOBBYOP

a year ago

About 150MB.


brody
EMPLOYEE

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
HOBBYOP

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?


brody
EMPLOYEE

a year ago

oh, sorry didnt notice the edit


brody
EMPLOYEE

a year ago

edited


royalgiant
HOBBYOP

a year ago

Np. Deploying now! Thanks for the help!


royalgiant
HOBBYOP

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


brody
EMPLOYEE

a year ago

are you sure that isnt a limitation of the plugin?


royalgiant
HOBBYOP

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


brody
EMPLOYEE

a year ago

okay ill deploy wordpress and see what i can figure out


royalgiant
HOBBYOP

a year ago

Sorry for the trouble and thanks for your help!


brody
EMPLOYEE

a year ago

no problem!


brody
EMPLOYEE

a year ago

> Remove upload limits


brody
EMPLOYEE

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
HOBBYOP

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.


brody
EMPLOYEE

a year ago

whatever works best for you


royalgiant
HOBBYOP

a year ago

Thanks for your help today anyways!


brody
EMPLOYEE

a year ago

no problem


Loading...