Is there a way to customize nginx proxy in google flexible appengine - google-app-engine

We are trying to running an application (a java servlet that connects to guacamole server) on flexible appengine, in our troubleshooting it looks like there is a nginx proxy on the google cloud instance (the instance from which docker image is running).
Is there a way we customize the nginx configuration the google cloud instance to help resolve our issues?

Nope. The proxy is part of our infrastructure that you can't really customize. Can you be a little more specific? What are you trying to do?

Related

Dockerized ReactJS & Express on Elastic Beanstalk

I'm working with a startup to build an app. I've been studying CS for 2 years, so I'm new to lots of things. For our app we have a ReactJS front-end, Express back-end, and MySQL database. Currently it's deployed on AWS Elastic Beanstalk in a NodeJS environment. I configured it to run react-scripts build after it's been deployed. It's serving the static React-generated files through the Express server (bad idea, I know). This has worked for a while, but now the instance is running out of memory when trying to build.
I've been looking into Docker as a better solution (I've never used Docker before this week), and now I have a local development setup with 3 containers: a MySQL container, a Node container running the backend, and an Alpine container just running react-scripts start. The front-end is using a proxy to connect to the backend. This is all working fine locally (except that my backend container can't connect to the Internet so an external API is broken), but I have no idea how to deploy this correctly to AWS.
With Elastic Beanstalk is there a way for me to build and deploy a single Docker container with the pre-built React front-end, configure Nginx to serve those static files, and then pass all /api requests to the Express server? I'm using RDS for the database, so I don't feel like I need to deploy another container for MySQL.
I don't expect you guys to solve my problem, but I'd appreciate being pointed in the right direction. Maybe I'm going about this completely the wrong way.
React App:
I suggest you deploy your react application on AWS Amplify. you can find resources on how to deploy on the internet very easily.
MySQL
You can host your MySQL database on an EC2 instance or use any other hosted service for the database.
Express App
Now you can host your express app on EBS using the docker platform. You can also get the resources for this on the internet.
===========================================================================
Now add your express app endpoint in AWS Amplify's environment to use it with react app.
Add MySQL URL to EBS's environment to use it with Express App.
Note: AWS amplify serves your app on HTTPS so you have to enable SSL on EBS also. You can do it with the AWS certificate manager by
getting an SSL certificate and attaching it to the EBS.
It will be easy if the domain is handled by Route53 but again you can also achieve this with any domain service provider.
It is recommended that you should migrate your domain to Route 53, as you will get more control and also many other benefits.
Refer this answer: https://stackoverflow.com/a/38225802/9323655
Hope my answer will guide you in the right direction.

Configure Basic HTTP Authentication with Google App Engine Node.js App

I'm running a GAE Standard Env. node/express app.
How can I configure Basic HTTP Authentication?
Is it possible to configure it with app.yaml?
I've read the docs, and did a lot of searching and so far it seems like I'll have to use my Express server to handle it. That seems weird because it requires that I have a server.
What if I wanted to serve a static HTML page? Then the express solution falls apart.
In nginx I can do this:
server {
...
auth_basic "Administrator’s Area";
auth_basic_user_file conf/htpasswd;
}
Is there an equivalent with app.yaml in GAE?
Thanks for your help =)
I think its not possible to do this type of authentication, but you have other options
- google sign in
- oauth
- firebase
* users api is available but not for node standard app engine
If you wanted to serve static html you might store it in Google Cloud Storage and Cloud storage has its own permissions options

Modifying Nginx configuration on Google Cloud App Engine Flexible Environment with Custom Runtime

The Nginx load balancer of Google Cloud App Engine Flexible Environment (with custom runtime) logs remote IP addresses etc. to its access logs. What if I wanted to disable that behavior? Is it possible in any way? Docs don't say anything about configuring Nginx by yourself. Haven't find anything from the console either.
In order to disable any IP logging, you have to disable the Google Cloud Load Balancer logs and also any logging done by NGINX.
In order to disable the ones done by the Load Balancer of Google Cloud, this page of their official documentation explains how to do it. You would need select "Disable log source" from the cloud HTTP Load Balancer.
On the other hand, to configure NGINX, apparently the only way to do so is modifying the nginx.conf file.
Because this you are using App Engine Flex and it's not possible to access these virtual machines/containers once the App had been deployed, you would need make sure to change the configuration before executing the deployment.
I've found a Serverfault post which does explain how to disable NGINX logging, and another article which does explain the NGINX configurations with better depth in case they might be of use for you.
I believe this won't be possible. As per this Logging docs page:
The App Engine flexible environment produces the following logs:
Request logs record requests sent to all App Engine apps. The request
log is provided by default and you cannot opt out of receiving it.
App logs record activity by software within the App Engine app. The
log is provided by default and you cannot opt out of receiving it.
Runtime logs are provided from the flexible environment using a
preinstalled Logging agent.

Connect App on App Engine to cluster running on GKE

I have a app running on GAE and i have a database running on google kubernetes engine. I have successfully tested the working database by forwarding port kubectl port-forward pod-name 3001:3001 and confirmed that it is working.
But my application cannot connect to it. I thought all apps within a project on Google cloud can access via localhost. Is that not true?
If not, then how do i connect my app on GAE to my database on GKE?
There are two ways:
A regular LoadBalancer which opens up the cluster to the public internet.
The other way is to use an internal LoadBalancer which only opens the traffic within google cloud.
Now, whether it opens it across the entire Gcloud network, just your projects or even just the one project is not clear to me. The docs were not clear in that regard either.
Maybe someone from Google Cloud team can help me here.
To convert a LoadBalancer service to an Internal LoadBalancer service, we add the following annotation:
annotations:
cloud.google.com/load-balancer-type: "Internal"
kubectl apply and then after a minute or so kubectl get services. You'll see an external ip address added to your service. The IP will be accessible to other apps on Gcloud, but not from the public internet.

Deploy Java Web Application and MySQL database in the cloud

my issue is that I've been developing a Java Web app in Netbeans 7.2, which I've used Hibernate and JSF Facelets to communicate and show the data from a MySQL database deployed in my local server (localhost).
But now, I want to deploy both (my java web app and mysql database) in the cloud in a web server, or something but I don't know even how to start this. I've seen something about Google App Engine, but I didn't get the idea, and many others...
I just need to deploy my app to give access to other people to use my web app.
Google Appengine is a Framework.
its not webserver where you can deploy your app as on your local machine.
what you are looking for is
Amazon EC2
Google ComputeEngine
OpenShift
and others...... (to many to list them all)
most of them are not free.
some like openshift are if you dont need much resources.
there you can install the server you need, (its just like a remote server)
and deploy your app to.

Resources