I created a build using ng build --prod. It created a dist/AppName folder and inside it I have my manifest.yml and Staticfile. When I do cf push inside dist/AppName everything is working fine but I wanted to add a header config of add_header 'Access-Control-Allow-Origin' '*' (nginx config) but I don't know how to do it in Staticfile. I got some lead like using location_include but the documentation about it is kinda confusing. Could someone help or guide me on how to do this. Thanks.
How to add header config using staticfile_buildpack for Angular app?
1.9k Views Asked by zorlac At
1
There are 1 best solutions below
Related Questions in ANGULAR
- Firebase link existing user to anonymous account?
- It doesnt always show all the books on my homepage
- Google adsense ads.txt status cannot be not found
- When I navigate to the URL'http://localhost:4200/', it redirects me back
- Ionic Angular Standalone ion-icon are not showing at all
- How to make Angular understand that view child is of a specific type, not a general ElementRef?
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- How to perform CRUD operations on a static JSON array in Angular? (without API)
- Ngrx props<>() method in createAction()
- How to animate rotation of an image inside input control?
- Detecting click inside and outside of the listening component in Angular
- Angular - type guard not narrowing types
- In node_modules file i am getting Angular genric error while using fontawesome in angular12
- Angular 16 sending null values to API
- GoogleCloud Error: Not Found The requested URL was not found on this server
Related Questions in NGINX
- Nginx reverse proxy with query parameters not working
- Root path analogue in uWSGI as in Uvicorn
- Keycloak: How to override Welcome Screen redirect behavior (to custom realm, instead of master realn/admin)
- nginx set up reverse proxy from subfolder to a port
- Nginx Not Correctly Redirecting Users To Custom Page
- How to connect to ssh server with domain name
- Nginx configuration file and SSL certificate errors in Docker
- Invalid Host header not being rejected by nginx
- Nginx only caches file endpoints
- How to configure Nginx for a VPS?
- Problem with changing default NGINX 404 error page
- My VPS does not accept HTTPS requests on a port other than 443
- NGINX Configuration Issue with Next.js and Strapi Project
- Openshift nginx proxy_pass not redirecting from current host to another
- Adonis.js in production : ENOENT: no such file or directory, open '/public/assets/.vite/manifest.json'
Related Questions in CLOUD-FOUNDRY
- Cloud Foundry : Java Build Pack : Opentelemtry Javagent extension integration with jar from a repo
- Getting "CF-InvalidAuthToken(1000): Invalid Auth Token" while launching the tasks in Spring Cloud Data Flow 2.11.1
- How to read logs from PCF?
- Is there a design pattern to handle the scaling up/down of an RMQ consumer app consuming messages from queues bound to a consistent hash exchange
- SAP UI5 Live Search in Input Box causing out of memory for the app on SAP BTP
- PCF Spring Cloud Config server not fetching properties from bitbucket
- PCF doesn't recognize the spring boot application
- Own changes in CloudFoundry development environment not visible to me only
- Trying to update Spring Cloud Dataflow v2.9.4 to 2.11.2 on Pivotal CloudFoundry but getting errors during deployment
- Zuul ServiceId route is not working on CloudFoundry
- How can i set msg.sender inside foundry script to account from encrypted keystore?
- Cloudfoundry Laravel "Could not open input file: artisan"
- Deploying net core app to pcf: start app timeout with health check 404 failure
- cf push failed due to java runtime version error
- How can the cf controller authenticate itself agains apps in BTP?
Related Questions in PCFDEV
- PCF doesn't recognize the spring boot application
- Zuul ServiceId route is not working on CloudFoundry
- How can i change PCF (pcf-scripts) default port?
- After upgrading to Spring Boot 3, PCF Gorouter emits different x-b3-traceid
- Cloud Foundry CPU Core
- PCF Tasks on Active/Passive
- How do I use Hashicorp Vault in Cloud Foundry
- PCF cfdev plugin install No Such Host Error
- Socket Connection Exception while accesss external api in Pivotal Cloud Foundary
- Clone the request to a different Application in pcf
- Token validation failing in PCF but validating in local
- How to retrieve heapdump in PCF using SMB
- PCF - x509: certificate has expired or is not yet valid
- what is the alternative in Tanzu for https://console.run.pivotal.io/
- Run Time Argumnets in PCF
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I managed to solve my issue by looking at the sameple staticfile-buildpack fixtures on github. When I do
ng build --prodAngular put the compiled code indist/AppName. Insidedistfolder I put themanifest.yml,Staticfileand added a new foldernginx/conf/includes. The new folder is where I put my headers.conf, which contains the add_header nginx directive.so
disthas the following files and foldersStaticfile has the following content:
manifest.yml:
I did the
cf pushinsidedistfolder