USGS-WiM / nawqa-sw-trends

Application showing trends for surface water
https://nawqatrends.wim.usgs.gov/swtrends/
Other
1 stars 1 forks source link

need to access png images on nawqatrends S3 bucket via https from within the app #245

Closed njestes closed 7 years ago

njestes commented 7 years ago

Another option:

Maybe we already have an https ready S3 bucket for these things. I can put the images there if need be.

aaronstephenson commented 7 years ago

If the images are within the same folder as the app, you could just use relative references. Otherwise, you could use the absolute path including the FQDN (which would route the traffic back thru Toad). Or, you could use the default S3 URL and use S3's SSL cert, for example:

https://s3.amazonaws.com/nawqatrends.wim.usgs.gov/nawqaimages/fwsLogo.png

njestes commented 7 years ago

I think the app is located on Toad, so the we'd be hosting them on Toad going that way (the same folder as the app way, that is). So, I think I'll try out that last URL structure you have there. I'll let you know...

aaronstephenson commented 7 years ago

Oh, the app is on Toad but the images are on S3? Sorry, I didn't realize that. In that case, we could just put a simple reverse proxy rule in the nawqatrends "website" in IIS. Easy peasy.

njestes commented 7 years ago

I just implemented this structure URL ->

https://s3.amazonaws.com/nawqatrends.wim.usgs.gov/nawqaimages/fwsLogo.png

and it seems good to go. Would there be a benefit to using the reverse proxy instead or is it six of one, half dozen of the other?

aaronstephenson commented 7 years ago

I'm fine with either. The only potential negative I see with using the direct S3 URL is that someone might see it in your source code. But totally your call.

njestes commented 7 years ago

The images are also meant to be clicked and opened in new tabs, so they would see it there. I don't have any problem with that, I don't think. But I might not be seeing all the possible issues with that.

aaronstephenson commented 7 years ago

Maybe it's just a "branding" o r"professional/polished" thing... do we want them to know we're using S3, or just the app's proper URL? Maybe something to ask the whole group.

njestes commented 7 years ago

I'm good with the reverse proxy thing. Set 'er up and see how it works?

aaronstephenson commented 7 years ago

Reverse proxy is enabled.

njestes commented 7 years ago

So, I'm looking for this: https://s3.amazonaws.com/nawqatrends.wim.usgs.gov/charts/Total%20Phosphorus_06741510/plotConcPred.png to convert to this: https://nawqatrends.wim.usgs.gov/charts/Total%20Phosphorus_06741510/plotConcPred.png

Seems like it's not quite there, though the https is happy, it's returning a 404

it's a 'charts' 'directory' at the root of the bucket

aaronstephenson commented 7 years ago

Oh sorry, I only set up the reverse proxy for /nawqaimages/. I just set one for /charts/ too. Try it again.

njestes commented 7 years ago

Closer, I think. Now, I'm getting the wim error page when I try this:

https://nawqatrends.wim.usgs.gov/charts/Total%20Phosphorus_06741510/plotFluxPred.png

This still works:

https://s3.amazonaws.com/nawqatrends.wim.usgs.gov/charts/Total%20Phosphorus_06741510/plotFluxPred.png

njestes commented 7 years ago

Might just be a refresh, still updating thing. This works:

https://s3.amazonaws.com/nawqatrends.wim.usgs.gov/charts/Total%20Phosphorus_06741510/plotFluxPred.png

aaronstephenson commented 7 years ago

I think that space might be screwing things up. Do you have an example without a space?

njestes commented 7 years ago

https://nawqatrends.wim.usgs.gov/charts/Alkalinity_09315000_4931276/plotFluxHistBoot.png

aaronstephenson commented 7 years ago

Bah, I give up. I can't figure out why the reverse proxy isn't working. Feel free to use the direct S3 URL. Sorry about the hold up.

njestes commented 7 years ago

cool. I'll code that up.