Reverse Proxy config for NGINX put at /etc/nginx/config.d is not working - kubernetes

I have an angular application hosted in docker container. Few of the static contents are read from some other server so that the reverse proxy configuration has been put at path /etc/nginx/conf.d/
but the proxy config is not working.
Below is the proxy config
server {
location /static/configs/ {
proxy_pass http://somewebsite.com/static-data/configs
}
}
Lets assume my application url is "http://angularapp.com/"
Now if I access http://angularapp.com/static/configs/json/config.json
then it is giving me HTTP 404 error.
I don't have rights to amend any other files on path /etc/nginx. I can only put conf file at conf.d and configuration in sites-enabled is already including the /etc/nginx/conf.d/*.conf files.
My application is installed on /opt/app/Web/ path and local resources on the path are accessible.

Related

websphere application server behind ingress redirects to dns:port

I am trying to run websphere behind ingress.
I have successfully configured the ingress for it and I am able to access the console.
The ip on which I am able to access the console is
https://mydomain/ibm/console/logon.jsp
Note: I have a domain , for which I created a A record.
When I login into the console ,
I am redirected to
https://mydomain:9043/ibm/console/
This page does not exist.
If I explicitly run the URL https://dns/ibm/console/login.do?action=secure. My application works fine.
Can someone tell me where is the configuration needed so that it is not redirected to dns:port?
I have created all the config following the URL:
Problem configuring websphere application server behind ingress
The request is http://hostname/ibm/console/logon.jsp and it returns http://hostname:9080/ibm/console/logon.jsp
This is causing confusion and thus we are facing an issue.
The port which our was app uses is controlled by two properties:
trusthostheaderport = true
com.ibm.ws.webcontainer.extractHostHeaderPort = true
These can be created in the WAS Admin console under:
Servers > Server Types > WebSphere application servers > [server_name] > Web Container Settings > Web container > Additional Properties > Custom Properties
Setting both of these properties with a value of "true" should force WAS to use the front-end port (from the Host header) instead of the Webcontainer port.
Note: You need to restart the service after the change ( restart in case of docker containers)
Please find the documentation here.

How do I make a golem app appear at a specific URL route

We let the golem package automatically create a Dockerfile for us and can run the docker image and see the app at the root directory: http://localhost:3838/?...
But we would like the app to appear in a subdirectory like http://localhost:3838/myApp/v1/?... so that we can set up the necessary proxying for Apache and have this and other apps all available from a single server.
We can manually edit the Dockerfile to copy a shiny-server.conf file with the following information:
# Define a server that listens on port 3838
server {
listen 3838;
# Define a location at the base URL
location /myApp/v1/ {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
}
}
The above solution feels like a hack and we are hoping there is functionality inside of golem that will allow us to set the subdirectory at which the app will appear.
Unfortunately there is no way to include an nginx configuration inside the Dockerfile programmatically: {golem} tries to help with the creation of the file, but some things still need to be done manually.
Also, note that {golem} doesn't create a Dockerfile with a shiny server in it, it creates a standalone docker image that launches the app, so there is no shiny server running, just an R process. {shiny} being what it is, there is no way to natively run it on a given path, it's always at the root, on a port.
That being said, what you can do is either edit the dockerfile so that it also bundle nginx (or any other load balancer), so that you can serve the app on a path, or serve your application on another port, using the port argument of add_dockerfile(): that might be easier to configure it with you Apache proxy.
Colin

Config Server in Play framework 2.7

I am implementing a web socket server application using play framework 2.7
I would like to implement a remote configuration where all the application's
configuration should reside in a github.
When i searched for documents to implement it, i found below url,
https://github.com/play-rconf
but accessing configuration from github is not listed.
Is there any better way or document do access the config server from github (like in Spring) ?
You can try play-rconf-http by specifying a URL of your config file:
remote-configuration {
## Provider - HTTP
# ~~~~~
# Retrieves configuration from a simple HTTP server
http {
# URL where is located the configuration file to fetch. You can
# use basic authentication
url = "https://raw.githubusercontent.com/<user>/<repo>/<branch>/<path-to-file>"
url = ${?REMOTECONF_HTTP_URL}
}
}
You can use basic authentication as well.
Look Download single files from GitHub for more info regarding GitHub link.

How to browse files on a webserver?

I have a web server with IP address and port.
I would like to browse all files on this web server. How can view and upload new files there?
For example, I have already tried via a web browser:
192.168.101.190:2870
But there is an error: 404 Not Found
192.168.101.190:2870/name1.xml/r/n
403 Forbidden
I have access to the files for example: *.xml
192.168.101.190:2870/name1.xml
192.168.101.190:2870/name2.xml
Server: NFLC/3.0 UPnP/1.0 DLNADOC/1.50
The feature you're looking for is Directory Listing/Directory Browsing. If your web server is:
Apache refer to: https://wiki.apache.org/httpd/DirectoryListings#Directory_Listings
IIS refer to: https://blogs.iis.net/bills/how-to-enable-directory-browsing-with-iis7-web-config
Nginx refer to: https://nginxlibrary.com/enable-directory-listing/

Making nextcloud work on a prefixed path (using docker and caddy)

I'm trying to setup my own instance of nextcloud on my server but I'm running into a problem as I want nextcloud to be available under https://example.com/cloud/.
Next cloud is running in a CoreOS virtual machine called let's say myvm.
So this is the way I setup my CaddyFile:
example.com {
gzip
proxy /cloud myvm:8080 {
transparent
without /cloud
}
}
I have other proxies that work fine for other services or VMs that are written similarily.
With this, and publishing port 8080 in my docker-compose file, I manage to connect to the nextcloud instance. But every time I go to example.com/cloud/ it will redirect me to example.com/apps/files/ instead of example.com/cloud/apps/files/.
If I enter this last url manually, I can access to nextcloud, but also the page doesn't load properly because all the contents cannot be loaded because they are not prompted with the prefix cloud/.
Is there a way to explain nextcloud about this prefix through the configuration of docker-compose file? (It's the only configuration I created, it works with just that and no extra work, I use one similar to the one available here (the apache one).)
Or maybe I can improve the CaddyFile config? (By the way, if I don't use the without option, it will just not work at all and return 404 when I go to the url).