Comments (9)
If that doesn't work, it sounds like you should just edit the source code to use url_for(..., _external=True, _scheme="https")
or whatever. I think a pull request wouldn't make sense because it's unlikely that the current pheweb has the same error.
from pheweb.
from pheweb.
You're right. urlprefix does not work like that. But I would be happy to make a PR for that new flag. I should get time in the next few weeks. I'll make a ticket for myself
from pheweb.
Okay, I'm surprised by the behavior you're reporting. Can you walk me through what's happening? Here's what I assume will happen:
- You run
pheweb serve --port=8080
. - You run Nginx/Apache to serve "https://pheweb.example.com/" (port 443) by proxying to localhost:8080.
- You go to "https://pheweb.example.com/random", and it redirects you to "/pheno/728". That is, it returns "301 REDIRECT" with the header "Location: /pheno/738". That happens because
get_random_page()
returns "/pheno/738", which is a non-external URL because this function is being called inside of an "active request context". - Your browser sends you to "https://pheweb.example.com/pheno/738" because it's a relative redirect.
Are you claiming that in this setup, you're redirected away from https to http? Could you share the console output of pheweb serve
as this happens, and maybe also your apache/nginx logs?
Or are you using a setup that's different from what I described?
What version of pheweb and flask are you using?
from pheweb.
This is the setup that I am working with. It was surprising for me too as this is the only link that seems to redirect away from https to http.
Keep in mind, I am running a version of PheWeb that is 3 years old. Due to the requirements of the project / the data format I am unable to update at this moment.
pheweb==1.1.14
flask==1.0.3 # via flask-compress, flask-login, pheweb
from pheweb.
Oh. What happens if you add this line to server.py
:
app.config['PREFERRED_URL_SCHEME'] = 'https'
from pheweb.
Makes sense. I'll give those a try. Thanks!
from pheweb.
After adding url_for(..., _external=True, _scheme="https")
to all of the url_for calls in get_random_page
and specifying proxy_set_header Host $http_host;
before proxy_pass in my nginx.conf
this issue was solved for me. Like you said, it's probably not an issue in the more recent versions and hopefully I can convince stakeholders to upgrade soon. Thanks!
from pheweb.
from pheweb.
Related Issues (20)
- failed to run 'pip3 install pheweb' HOT 4
- Support input in gwas-vcf format HOT 4
- gene-based pheweb site HOT 1
- error when there is NA for allele frequency HOT 2
- Phecodes HOT 1
- Installation via miniconda & native python breaks at build step for cffi HOT 7
- Hiding download buttons HOT 1
- Enhancing the search bar HOT 1
- adding vep annotation manually
- Genetic correlations are not shown HOT 2
- -log10 pvalue input support HOT 1
- Save manhattan plot as png/svg HOT 1
- Variants page is not displayed HOT 3
- Easier Way to Use Custom LD? HOT 6
- URI as assoc_files in pheno_list.json HOT 1
- Core features of pheweb: ref/alt, add_rsid, hg17/38 HOT 3
- stroke
- ModuleNotFoundError: No module named 'pheweb.command_line' HOT 3
- 404 not found error of phewas plot page (Pheweb with structural variants) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pheweb.